fix: bots are not killable after the changelevel. fixes #143

This commit is contained in:
ds 2020-07-15 21:58:57 +03:00
commit 2580c9478c
2 changed files with 2 additions and 1 deletions

View file

@ -2977,7 +2977,7 @@ void Bot::update () {
if (cv_tkpunish.int_ () != 2 || util.isFakeClient (game.entityOfIndex (m_voteKickIndex))) { if (cv_tkpunish.int_ () != 2 || util.isFakeClient (game.entityOfIndex (m_voteKickIndex))) {
return; return;
} }
edict_t *killer = game.entityOfIndex (m_lastVoteKick); auto killer = game.entityOfIndex (m_lastVoteKick);
++killer->v.frags; ++killer->v.frags;
MDLL_ClientKill (killer); MDLL_ClientKill (killer);

View file

@ -91,6 +91,7 @@ void BotManager::createKillerEntity () {
void BotManager::destroyKillerEntity () { void BotManager::destroyKillerEntity () {
if (!game.isNullEntity (m_killerEntity)) { if (!game.isNullEntity (m_killerEntity)) {
engfuncs.pfnRemoveEntity (m_killerEntity); engfuncs.pfnRemoveEntity (m_killerEntity);
m_killerEntity = nullptr;
} }
} }