Fix a bug where the server would crash if Drain killed a mob.

This commit is contained in:
dongresource 2020-11-11 23:35:00 +01:00
parent 90754665a0
commit 2744ed64e3
1 changed files with 4 additions and 0 deletions

View File

@ -481,6 +481,10 @@ void MobManager::combatStep(Mob *mob, time_t currTime) {
mob->lastDrainTime = currTime;
}
// if drain killed the mob, return early
if (mob->appearanceData.iHP <= 0)
return;
// unbuffing
std::unordered_map<int32_t, time_t>::iterator it = mob->unbuffTimes.begin();
while (it != mob->unbuffTimes.end()) {