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