From 2580c9478c32b3cfe89e08d6b93a400e3a1aa96c Mon Sep 17 00:00:00 2001 From: ds Date: Wed, 15 Jul 2020 21:58:57 +0300 Subject: [PATCH] fix: bots are not killable after the changelevel. fixes #143 --- src/botlib.cpp | 2 +- src/manager.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index 02dc84c..4fe3a14 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2977,7 +2977,7 @@ void Bot::update () { if (cv_tkpunish.int_ () != 2 || util.isFakeClient (game.entityOfIndex (m_voteKickIndex))) { return; } - edict_t *killer = game.entityOfIndex (m_lastVoteKick); + auto killer = game.entityOfIndex (m_lastVoteKick); ++killer->v.frags; MDLL_ClientKill (killer); diff --git a/src/manager.cpp b/src/manager.cpp index 3d9abcf..6f6a918 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -91,6 +91,7 @@ void BotManager::createKillerEntity () { void BotManager::destroyKillerEntity () { if (!game.isNullEntity (m_killerEntity)) { engfuncs.pfnRemoveEntity (m_killerEntity); + m_killerEntity = nullptr; } }