Hack fix for targets not being cleared.

This commit is contained in:
JezuzLizard 2023-04-30 02:31:15 -07:00
parent c7558faa47
commit 52ebe9961f

View File

@ -270,12 +270,33 @@ spawned()
self thread doBotMovement();
self thread walk();
self thread target();
self thread target_cleanup();
self thread updateBones();
self thread aim();
self notify( "bot_spawned" );
}
target_cleanup()
{
self endon( "disconnect" );
self endon( "zombified" );
while ( true )
{
wait 10;
curTime = getTime();
targetKeys = getArrayKeys( self.bot.targets );
for ( i = 0; i < targetKeys.size; i++ )
{
obj = self.bot.targets[ targetKeys[ i ] ];
if ( ( curTime - obj.time ) > 30000 )
{
self.bot.targets[ targetKeys[ i ] ] = undefined;
}
}
}
}
/*
Bot moves towards the point
*/