this.realowner,
this.origin,
false,
- false,
- 1
+ false
);
vehspawncount++;
this.realowner,
this.realowner,
this.origin,
+ false,
false,
false,
1
return true;
}
-entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)
+entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag)
{
e.spawnflags = TSF_SUSPENDED;
if(!respwn) { e.spawnflags |= TSL_NO_RESPAWN; }
- // if(invincible) { e.damage_flags |= TFL_DMG_NO; }
+ if(invincible) { e.damage_flags |= TFL_DMG_NO; }
setorigin(e, orig);
bool allow_any = boolean(turret == "anyrandom");
return NULL; // no good
}
// select a random valid turret type if no valid turret was provided
- return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, removeifinvalid, moveflag);
+ return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, invincible, removeifinvalid, moveflag);
}
}
e.realowner = spawnedby;
- // TODO: Create a turret .entity moveflag
- //if(moveflag && e.turret_flags == TUR_FLAG_MOVE)
- // e.monster_moveflags = moveflag;
+ if(moveflag)
+ e.turret_flags = TUR_FLAG_MOVE;
if(IS_PLAYER(spawnedby))
{
if(teamplay)
e.team = spawnedby.team; // colors handled in spawn code
- // TODO: Create a turret .entity moveflag
+ // TODO: Create a "following player" feature when turret has moveflag
//if(autocvar_g_monsters_owners)
// e.monster_follow = own; // using .owner makes the monster non-solid for its master
float autocvar_g_turrets_targetscan_maxdelay;
float autocvar_g_turrets_targetscan_mindelay;
+entity spawnturret(entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag);
entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim);
void turret_projectile_explode(entity this);
float turret_validate_target(entity e_turret, entity e_target, float validate_flags);
return true;
}
-entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)
+entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid)
{
e.spawnflags = VHF_MULTISLOT;
-
+
+ // TODO: Make a respawn option, the following line isn't functional
if(!respwn) { e.spawnflags |= VHF_ISVEHICLE; }
setorigin(e, orig);
bool allow_any = boolean(vehicle == "anyrandom");
return NULL; // no good
}
// select a random valid vehicle type if no valid vehicle was provided
- return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid, moveflag);
+ return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid);
}
}
.float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
+entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid);
void vehicles_exit(entity vehic, int eject);
bool vehicle_initialize(entity this, Vehicle info, float nodrop);
bool vehicle_impulse(entity this, int imp);