mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(Core/Players): PlayerFlag helpers (#11294)
* feat(Core/Players): PlayerFlag helpers * Update Player.h * fix build
This commit is contained in:
@@ -60,7 +60,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||
|
||||
recv_data.read_skip<uint8>();
|
||||
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
@@ -417,7 +417,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ
|
||||
DoLootRelease(lguid);
|
||||
|
||||
bool instantLogout = ((GetSecurity() >= 0 && uint32(GetSecurity()) >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))
|
||||
|| (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight();
|
||||
|| (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight();
|
||||
|
||||
bool preventAfkSanctuaryLogout = sWorld->getIntConfig(CONFIG_AFK_PREVENT_LOGOUT) == 1
|
||||
&& GetPlayer()->isAFK() && sAreaTableStore.LookupEntry(GetPlayer()->GetAreaId())->IsSanctuary();
|
||||
@@ -426,7 +426,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ
|
||||
&& GetPlayer()->isAFK();
|
||||
|
||||
/// TODO: Possibly add RBAC permission to log out in combat
|
||||
bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
bool canLogoutInCombat = GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
|
||||
uint32 reason = 0;
|
||||
if (GetPlayer()->IsInCombat() && !canLogoutInCombat)
|
||||
@@ -501,7 +501,7 @@ void WorldSession::HandleTogglePvP(WorldPacket& recv_data)
|
||||
else
|
||||
GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
|
||||
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
if (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
GetPlayer()->UpdatePvP(true, true);
|
||||
else if (!GetPlayer()->pvpInfo.IsHostile && GetPlayer()->IsPvP()) // pussywizard: in pvp mode, but doesn't want to be and not in hostile territory, so start timer
|
||||
GetPlayer()->UpdatePvP(true, false);
|
||||
@@ -645,7 +645,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
|
||||
// body not released yet
|
||||
if (!_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (!_player->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
Corpse* corpse = _player->GetCorpse();
|
||||
@@ -1549,7 +1549,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data)
|
||||
uint8 mode;
|
||||
recv_data >> mode;
|
||||
|
||||
mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
mode ? _player->SetPlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
|
||||
LOG_DEBUG("network", "Client used \"/timetest {}\" command", mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user