mirror of
https://github.com/JezuzLizard/t4sp_bot_warfare.git
synced 2025-04-23 06:55:44 +00:00
small fixes
This commit is contained in:
parent
411a1a047a
commit
e25adccf15
@ -6,25 +6,29 @@
|
|||||||
Finder( eObj )
|
Finder( eObj )
|
||||||
{
|
{
|
||||||
answer = [];
|
answer = [];
|
||||||
ents = getentarray( "script_model", "classname" );
|
|
||||||
|
|
||||||
if ( self inLastStand() )
|
if ( self inLastStand() )
|
||||||
{
|
{
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ents = getentarray( "script_model", "classname" );
|
||||||
|
|
||||||
for ( i = 0; i < ents.size; i++ )
|
for ( i = 0; i < ents.size; i++ )
|
||||||
{
|
{
|
||||||
|
// not a powerup script_model
|
||||||
if ( !isDefined( ents[i].powerup_name ) )
|
if ( !isDefined( ents[i].powerup_name ) )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// can we path to it?
|
||||||
if ( GetPathIsInaccessible( self.origin, ents[i].origin ) )
|
if ( GetPathIsInaccessible( self.origin, ents[i].origin ) )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure we are the only one going for it
|
||||||
if ( self GetBotsAmountForEntity( ents[i] ) >= 1 )
|
if ( self GetBotsAmountForEntity( ents[i] ) >= 1 )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -56,6 +60,7 @@ Executer( eObj )
|
|||||||
self endon( "zombified" );
|
self endon( "zombified" );
|
||||||
|
|
||||||
powerup = eObj.eEnt;
|
powerup = eObj.eEnt;
|
||||||
|
org = powerup.origin;
|
||||||
|
|
||||||
self thread IncrementBotsForEntity( powerup );
|
self thread IncrementBotsForEntity( powerup );
|
||||||
self thread WatchForCancel( powerup );
|
self thread WatchForCancel( powerup );
|
||||||
@ -66,6 +71,12 @@ Executer( eObj )
|
|||||||
self DecrementBotsForEntity( powerup );
|
self DecrementBotsForEntity( powerup );
|
||||||
self ClearScriptGoal();
|
self ClearScriptGoal();
|
||||||
|
|
||||||
|
if ( distance( org, self.origin ) <= 64 )
|
||||||
|
{
|
||||||
|
eObj.sReason = "completed";
|
||||||
|
eObj.bWasSuccessful = true;
|
||||||
|
}
|
||||||
|
|
||||||
self CompletedObjective( eObj.bWasSuccessful, eObj.sReason );
|
self CompletedObjective( eObj.bWasSuccessful, eObj.sReason );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ WatchForCancelRevive( revivee )
|
|||||||
self endon( "zombified" );
|
self endon( "zombified" );
|
||||||
self endon( "WatchForCancelRevive" );
|
self endon( "WatchForCancelRevive" );
|
||||||
|
|
||||||
|
org = revivee.origin;
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
wait 0.05;
|
wait 0.05;
|
||||||
@ -119,6 +121,12 @@ WatchForCancelRevive( revivee )
|
|||||||
self CancelObjective( "revivee.revivetrigger.beingrevived && !self isReviving( revivee )" );
|
self CancelObjective( "revivee.revivetrigger.beingrevived && !self isReviving( revivee )" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( distance( revivee.origin, org ) > 16 )
|
||||||
|
{
|
||||||
|
self CancelObjective( "distance( revivee.origin, org ) > 16" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user