improved cap capflag

This commit is contained in:
ineedbots 2021-08-25 11:02:06 -06:00
parent a0380ed024
commit 7bb3b35887

View File

@ -4511,6 +4511,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
*/
@ -4527,12 +4539,30 @@ bot_cap_get_flag( flag )
evt = self waittill_any_return( "goal", "bad_path", "new_goal" );
wait 1;
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;
if ( evt != "new_goal" )
self ClearBotGoal();
}
/*