mirror of
https://github.com/JezuzLizard/t4sp_bot_warfare.git
synced 2025-04-22 22:45:43 +00:00
Hack fix for targets not being cleared.
This commit is contained in:
parent
c7558faa47
commit
52ebe9961f
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user