some bot awareness threads

This commit is contained in:
ineed bots
2024-09-23 13:38:05 -06:00
parent 2cfed9d4ab
commit 0a0c63ca76
2 changed files with 389 additions and 0 deletions
+46
View File
@@ -853,6 +853,52 @@ _timeout( delay )
self notify( "returned", "timeout" );
}
/*
From newer gscs
*/
waittill_any_return( string1, string2, string3, string4, string5 )
{
if ( ( !isdefined( string1 ) || string1 != "death" ) &&
( !isdefined( string2 ) || string2 != "death" ) &&
( !isdefined( string3 ) || string3 != "death" ) &&
( !isdefined( string4 ) || string4 != "death" ) &&
( !isdefined( string5 ) || string5 != "death" ) )
{
self endon( "death" );
}
ent = spawnstruct();
if ( isdefined( string1 ) )
{
self thread waittill_string( string1, ent );
}
if ( isdefined ( string2 ) )
{
self thread waittill_string( string2, ent );
}
if ( isdefined ( string3 ) )
{
self thread waittill_string( string3, ent );
}
if ( isdefined ( string4 ) )
{
self thread waittill_string( string4, ent );
}
if ( isdefined ( string5 ) )
{
self thread waittill_string( string5, ent );
}
ent waittill( "returned", msg );
ent notify( "die" );
return msg;
}
/*
If the weapon is allowed to be dropped
*/