fixed crash in modcmd.c (bots could be destroyed inside a function)