void assault_setenemytoobjective(entity this)
{
- FOREACH_ENTITY_STRING(targetname, this.target,
+ IL_EACH(g_assault_objectives, it.targetname == this.target,
{
- if(it.classname == "target_objective")
- {
- if(this.enemy == NULL)
- this.enemy = it;
- else
- objerror(this, "more than one objective as target - fix the map!");
- break;
- }
+ if(this.enemy == NULL)
+ this.enemy = it;
+ else
+ objerror(this, "more than one objective as target - fix the map!");
+ break;
});
if(this.enemy == NULL)
// trigger new round
// reset objectives, toggle spawnpoints, reset triggers, ...
-void vehicles_clearreturn(entity veh);
-void vehicles_spawn(entity this);
void assault_new_round(entity this)
{
//bprint("ASSAULT: new round\n");
- // Eject players from vehicles
- FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, vehicles_exit(it.vehicle, VHEF_RELEASE));
-
- IL_EACH(g_vehicles, true,
- {
- vehicles_clearreturn(it);
- vehicles_spawn(it);
- });
-
// up round counter
this.winning = this.winning + 1;
if (!g_assault) { delete(this); return; }
this.classname = "target_objective";
+ IL_PUSH(g_assault_objectives, this);
this.use = assault_objective_use;
this.reset = assault_objective_reset;
this.reset(this);
turret.team = 5; // this gets reversed when match starts?
}
-MUTATOR_HOOKFUNCTION(as, VehicleSpawn)
+MUTATOR_HOOKFUNCTION(as, VehicleInit)
{
entity veh = M_ARGV(0, entity);
return (frag_victim.classname == "func_assault_destructible");
}
-MUTATOR_HOOKFUNCTION(as, GetTeamCount)
+MUTATOR_HOOKFUNCTION(as, CheckAllowedTeams)
{
// assault always has 2 teams
c1 = c2 = 0;