mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Update IndividualProgressionPlayer.cpp
add message with reason for not being able to invite
This commit is contained in:
@@ -311,13 +311,20 @@ public:
|
|||||||
|
|
||||||
bool OnPlayerCanGroupInvite(Player* player, std::string& membername) override
|
bool OnPlayerCanGroupInvite(Player* player, std::string& membername) override
|
||||||
{
|
{
|
||||||
|
Player* otherPlayer = ObjectAccessor::FindPlayerByName(membername, false);
|
||||||
|
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
||||||
|
uint8 otherPlayerState = otherPlayer->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
||||||
|
|
||||||
if (!sIndividualProgression->enabled || !sIndividualProgression->enforceGroupRules || isExcludedFromProgression(player))
|
if (!sIndividualProgression->enabled || !sIndividualProgression->enforceGroupRules || isExcludedFromProgression(player))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Player* otherPlayer = ObjectAccessor::FindPlayerByName(membername, false);
|
|
||||||
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
if (sIndividualProgression->enforceGroupRules && (currentState != otherPlayerState))
|
||||||
uint8 otherPlayerState = otherPlayer->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
{
|
||||||
|
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Unable to invite this player, because Enforce Group Rules is enabled.|r");
|
||||||
|
}
|
||||||
|
|
||||||
return (currentState == otherPlayerState);
|
return (currentState == otherPlayerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user