X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fsv_turrets.qc;h=c90eaff1fe98fdb22bc7918fefedd1f28c703738;hb=29fae4d9d59e5ec8afbdd6ef0ebcc5dcdc1bfa3f;hp=71181f209eeed787652d166d2a9e0e1e345a425c;hpb=05ee5b1212a6537e5c5acb76dbc1ef9df40f85c6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 71181f209..c90eaff1f 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -1,3 +1,4 @@ +#include "sv_turrets.qh" #ifdef SVQC #include @@ -193,8 +194,8 @@ void turret_die(entity this) { tur.tr_death(tur, this); - remove(this.tur_head); - remove(this); + delete(this.tur_head); + delete(this); } else { @@ -440,7 +441,7 @@ void turret_projectile_explode(entity this) #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) @@ -476,7 +477,9 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f 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); + IL_PUSH(g_bot_dodge, proj); proj.enemy = actor.enemy; proj.totalfrags = _death; PROJECTILE_MAKETRIGGER(proj); @@ -824,7 +827,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl */ #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; @@ -1174,7 +1177,7 @@ void turret_think(entity this) */ 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; @@ -1199,7 +1202,8 @@ void turrets_manager_think(entity this) 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); @@ -1248,6 +1252,8 @@ bool turret_initialize(entity this, Turret tur) // if tur_head exists, we can assume this turret re-spawned if(!this.tur_head) { tur.tr_precache(tur); + IL_PUSH(g_turrets, this); + IL_PUSH(g_bot_targets, this); } entity e = find(NULL, classname, "turret_manager"); @@ -1349,7 +1355,7 @@ bool turret_initialize(entity this, Turret tur) 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 != "") @@ -1358,7 +1364,7 @@ bool turret_initialize(entity this, Turret tur) if (this.tur_defend == NULL) { this.target = ""; - LOG_TRACE("Turret has invalid defendpoint!\n"); + LOG_TRACE("Turret has invalid defendpoint!"); } }