improved cap capflag

This commit is contained in:
ineedbots 2021-08-25 11:01:58 -06:00
parent bdea53b670
commit 0884902695

View File

@ -4529,6 +4529,18 @@ bot_cap()
}
}
/*
Gets the carriers ent num
*/
getCarrierEntNum()
{
carrierNum = -1;
if (isDefined(self.carrier))
carrierNum = self.carrier getEntityNumber();
return carrierNum;
}
/*
Bots go and get the flag
*/
@ -4545,12 +4557,30 @@ bot_cap_get_flag( flag )
evt = self waittill_any_return( "goal", "bad_path", "new_goal" );
wait 1;
self.bot_lock_goal = false;
if ( evt != "new_goal" )
self ClearScriptGoal();
if ( evt != "goal" )
{
self.bot_lock_goal = false;
return;
}
self SetScriptGoal( self.origin, 64 );
curCarrier = flag getCarrierEntNum();
while ( curCarrier == flag getCarrierEntNum() && self isTouching( flag.trigger ) )
{
cur = flag.curProgress;
wait 0.5;
if ( flag.curProgress == cur )
break;//some enemy is near us, kill him
}
self ClearScriptGoal();
self.bot_lock_goal = false;
}
/*