mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-19 16:32:53 +00:00
fix this var leak
This commit is contained in:
parent
223c6e4664
commit
d19be1dd2d
@ -30,6 +30,48 @@ main()
|
||||
{
|
||||
println( "FATAL: NO BUILT-INS FOR BOTS" );
|
||||
}
|
||||
|
||||
// fix var leak
|
||||
BotBuiltinReplaceFunc( BotBuiltinGetFunction( "maps/mp/gametypes/_hud_util", "destroyelem" ), ::destroyElemFixed );
|
||||
}
|
||||
|
||||
/*
|
||||
Fix leak with menus
|
||||
*/
|
||||
removeChildFixed( element )
|
||||
{
|
||||
temp = [];
|
||||
|
||||
for ( i = 0; i < self.children.size ; i++ )
|
||||
{
|
||||
if ( isdefined( self.children[ i ] ) && self.children[ i ] != element )
|
||||
{
|
||||
self.children[ i ].index = temp.size;
|
||||
temp[ temp.size ] = self.children[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
self.children = temp;
|
||||
}
|
||||
|
||||
/*
|
||||
Fix leak with menus
|
||||
*/
|
||||
destroyElemFixed()
|
||||
{
|
||||
if ( !isdefined( self ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isdefined( self.parent ) )
|
||||
{
|
||||
self.parent removeChildFixed( self );
|
||||
}
|
||||
|
||||
func = BotBuiltinGetFunction( "maps/mp/gametypes/_hud_util", "destroyelem" );
|
||||
disableDetourOnce( func );
|
||||
self [[ func ]]();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user