mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-04 22:40:05 +00:00
Fix regression with a disconnect check in MobManager::combatStep()
This commit is contained in:
parent
ce1a5a7664
commit
15b63f3cbd
@ -488,11 +488,19 @@ void MobManager::deadStep(Mob *mob, time_t currTime) {
|
||||
void MobManager::combatStep(Mob *mob, time_t currTime) {
|
||||
assert(mob->target != nullptr);
|
||||
|
||||
// lose aggro if the player lost connection
|
||||
if (PlayerManager::players.find(mob->target) == PlayerManager::players.end()) {
|
||||
mob->target = nullptr;
|
||||
mob->state = MobState::RETREAT;
|
||||
if (!aggroCheck(mob, currTime))
|
||||
clearDebuff(mob);
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = PlayerManager::getPlayer(mob->target);
|
||||
|
||||
// Lose aggro if the player lost connection, became invulnerable or died
|
||||
// lose aggro if the player became invulnerable or died
|
||||
if (plr->HP <= 0
|
||||
|| PlayerManager::players.find(mob->target) == PlayerManager::players.end()
|
||||
|| (plr->iSpecialState & CN_SPECIAL_STATE_FLAG__INVULNERABLE)) {
|
||||
mob->target = nullptr;
|
||||
mob->state = MobState::RETREAT;
|
||||
|
Loading…
Reference in New Issue
Block a user