Quick-fix for doDamage() crash

Couldn't get a reliable repro, but this is probably what that bug was.
It's not very throughly investigated, but we'll be tweaking those parts
of the codebase anyway, so we can examine if there's a deeper issue
later.
This commit is contained in:
dongresource 2022-02-08 17:00:43 +01:00
parent 6412a9a89e
commit 28bfd14362

View File

@ -226,7 +226,7 @@ void Combat::killMob(CNSocket *sock, Mob *mob) {
mob->killedTime = getTime(); // XXX: maybe introduce a shard-global time for each step?
// check for the edge case where hitting the mob did not aggro it
if (sock != nullptr) {
if (sock != nullptr && PlayerManager::players.find(sock) != PlayerManager::players.end()) {
Player* plr = PlayerManager::getPlayer(sock);
Items::DropRoll rolled;