Hi all,
I'm writing totaly new bot for HL1 MOD.
Bot join in the game perfect, move correct and anything that I want from
him. But when I try to kick him the game just crash.
BotThink() is called in StartFrame() only for valid bots, i.e I make the
needed check.
In ClientDisconnect() I free the bot pointer that is used in
StartFrame() so BotThink() is not called anymore for this bot edict.
Here the code that I use to check the stuff out:
void StartFrame( void )
{
// call the think function for the bot...
for (int i = 0; i < gpGlobals->maxClients; i++)
{
if (pBot[i])
pBot[i]->BotThink();
}
// other code....
}
void ClientDisconnect( edict_t *pEntity )
{
CBasePlayer *pPlayer = ((CBasePlayer *)CBaseEntity::Instance(
pEntity ));
for (int i = 0; i < gpGlobals->maxClients; i++)
{
if (pBot[i] == pPlayer)
{
pBot[i] = NULL;
}
}
// other stuff....
}
So the Bot pointer is set to NULL and BotThink() for this Bot is not
called anymore in StartFrame() but still when I kick him the game crash.
What I'm supposed to do?
Regards,
The Storm
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders