mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 00:06:11 +00:00
feat(Core/Players): PlayerFlag helpers (#11294)
* feat(Core/Players): PlayerFlag helpers * Update Player.h * fix build
This commit is contained in:
@@ -1984,7 +1984,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
bool noXPGain = player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
bool noXPGain = player->HasPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
bool doSwitch = false;
|
||||
auto toggleXpCost = sWorld->getIntConfig(CONFIG_TOGGLE_XP_COST);
|
||||
|
||||
@@ -2012,12 +2012,12 @@ public:
|
||||
else if (noXPGain)
|
||||
{
|
||||
player->ModifyMoney(-toggleXpCost);
|
||||
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
player->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
}
|
||||
else if (!noXPGain)
|
||||
{
|
||||
player->ModifyMoney(-toggleXpCost);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
}
|
||||
}
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
Reference in New Issue
Block a user