+#include "sv_turrets.qh"
#ifdef SVQC
#include <server/autocvars.qh>
{
tur.tr_death(tur, this);
- remove(this.tur_head);
- remove(this);
+ delete(this.tur_head);
+ delete(this);
}
else
{
#else
RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
#endif
- remove(this);
+ delete(this);
}
void turret_projectile_touch(entity this, entity toucher)
proj.nextthink = time + 9;
set_movetype(proj, MOVETYPE_FLYMISSILE);
proj.velocity = normalize(actor.tur_shotdir_updated + randomvec() * actor.shot_spread) * actor.shot_speed;
- proj.flags = FL_PROJECTILE;
+ proj.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, proj);
proj.enemy = actor.enemy;
proj.totalfrags = _death;
PROJECTILE_MAKETRIGGER(proj);
*/
#ifdef TURRET_DEBUG_TARGETSELECT
- LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
+ LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname);
#endif
return 1;
*/
void turret_use(entity this, entity actor, entity trigger)
{
- LOG_TRACE("Turret ",this.netname, " used by ", actor.classname, "\n");
+ LOG_TRACE("Turret ",this.netname, " used by ", actor.classname);
this.team = actor.team;
if (autocvar_g_turrets_reloadcvars == 1)
{
- FOREACH_ENTITY_FLAGS(turret_flags, TUR_FLAG_ISTURRET, {
+ IL_EACH(g_turrets, true,
+ {
load_unit_settings(it, true);
Turret tur = get_turretinfo(it.m_id);
tur.tr_think(tur, it);
// if tur_head exists, we can assume this turret re-spawned
if(!this.tur_head) {
tur.tr_precache(tur);
+ IL_PUSH(g_turrets, this);
}
entity e = find(NULL, classname, "turret_manager");
this.tur_head.owner = this;
this.tur_head.takedamage = DAMAGE_NO;
this.tur_head.solid = SOLID_NOT;
- this.tur_head.move_movetype = this.move_movetype;
+ set_movetype(this.tur_head, this.move_movetype);
if(!this.tur_defend)
if(this.target != "")
if (this.tur_defend == NULL)
{
this.target = "";
- LOG_TRACE("Turret has invalid defendpoint!\n");
+ LOG_TRACE("Turret has invalid defendpoint!");
}
}