invalid free fixed

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@725 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-11-25 14:33:00 +00:00
parent acb6590343
commit 8272138c2c
4 changed files with 10 additions and 22 deletions
+3 -3
View File
@@ -325,7 +325,7 @@ void CBotManager::EndMap()
// Remove all bots
loopv(bots)
{
if (!bots[i])
if(!bots[i] || !bots[i]->pBot)
continue;
// Store bots so they can be re-added after map change
@@ -907,7 +907,7 @@ botent *CBotManager::CreateBot(const char *team, const char *skill, const char *
#if defined VANILLA_CUBE
m->pBot = new CCubeBot;
#elif defined AC_CUBE
m->pBot = new CACBot;
m->pBot = new CACBot;
#else
#error "Unsupported mod!"
#endif
@@ -1086,7 +1086,7 @@ void kickallbots(void)
delete bots[i]->pBot;
freebotent(bots[i]);
}
}
};
bots.setsize(0);
}