From 839f9a813c938584591bb2bc69d7ac713f4b3220 Mon Sep 17 00:00:00 2001 From: CPunch Date: Thu, 1 Oct 2020 19:20:44 -0500 Subject: [PATCH] remove player from map in weird edgecase --- src/CNShardServer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CNShardServer.cpp b/src/CNShardServer.cpp index 7c22600..589a31e 100644 --- a/src/CNShardServer.cpp +++ b/src/CNShardServer.cpp @@ -64,8 +64,12 @@ void CNShardServer::_killConnection(CNSocket* cns) { Player* plr = PlayerManager::getPlayer(cns); - if (plr == nullptr) + if (plr == nullptr) { // this shouldn't happen if everything works correctly... + PlayerManager::removePlayer(cns); + + // also, hopefully the player's progress was already saved since the last db save interval, but rip those 2 mins of progress lol return; + } int64_t key = plr->SerialKey;