[Cleanup] Utilize GetPlayerState() in mob methods (#3066)

# Notes
- This method was unused, make use of it.
This commit is contained in:
Alex King 2023-03-16 20:23:34 -04:00 committed by GitHub
parent cc6bcf3295
commit 7961d7afa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -2989,7 +2989,7 @@ void Bot::AI_Process()
return;
}
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))) {
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))) {
SendAddPlayerState(PlayerState::Aggressive);
}
@ -3595,7 +3595,7 @@ void Bot::AI_Process()
GetPet()->SetTarget(nullptr);
}
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)) {
if (GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive)) {
SendRemovePlayerState(PlayerState::Aggressive);
}

View File

@ -1473,7 +1473,7 @@ void Merc::AI_Process() {
return;
}
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);
bool atCombatRange = false;
@ -1716,7 +1716,7 @@ void Merc::AI_Process() {
confidence_timer.Disable();
_check_confidence = false;
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))
if (GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))
SendRemovePlayerState(PlayerState::Aggressive);
if(!check_target_timer.Enabled())

View File

@ -1211,7 +1211,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.class_ = class_;
ns->spawn.gender = gender;
ns->spawn.level = level;
ns->spawn.PlayerState = m_PlayerState;
ns->spawn.PlayerState = GetPlayerState();
ns->spawn.deity = deity;
ns->spawn.animation = 0;
ns->spawn.findable = findable?1:0;

View File

@ -1085,7 +1085,7 @@ void Mob::AI_Process() {
}
}
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);
// NPCs will forget people after 10 mins of not interacting with them or out of range
@ -1381,7 +1381,7 @@ void Mob::AI_Process() {
}
}
else {
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))
if (GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))
SendRemovePlayerState(PlayerState::Aggressive);
if (IsPetStop()) // pet stop won't be engaged, so we will always get here and we want the above branch to execute