From 28bfd14362f408fea5d0e8e25d97204eca842845 Mon Sep 17 00:00:00 2001 From: dongresource Date: Tue, 8 Feb 2022 17:00:43 +0100 Subject: [PATCH] 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. --- src/Combat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Combat.cpp b/src/Combat.cpp index 391a267..ddb3e25 100644 --- a/src/Combat.cpp +++ b/src/Combat.cpp @@ -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;