diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 4b90c08..54fc6a7 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -572,21 +572,21 @@ void Room::OnHumanDie(Human* hum) if (hum->GetRace() == kHumanRace) { RemoveRescue(hum); hum->DeadDrop(); + for (auto& pair : human_hash_) { + if (pair.second != hum) { + pair.second->WinExp(hum, hum->meta->i->dead_exp()); + } + } + { + Human* killer = GetPlayerByUniId(hum->stats.killer_id); + if (killer && killer != hum) { + killer->WinExp(hum, hum->meta->i->killer_exp()); + } + } } else if (hum->GetRace() == kZombieRace) { } else { abort(); } - for (auto& pair : human_hash_) { - if (pair.second != hum) { - pair.second->WinExp(hum, hum->meta->i->dead_exp()); - } - } - { - Human* killer = GetPlayerByUniId(hum->stats.killer_id); - if (killer && killer != hum) { - killer->WinExp(hum, hum->meta->i->killer_exp()); - } - } NotifyUiUpdate(); } else { --alive_count_;