X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fsv_turrets.qc;h=d8587b14a809954a433f033fe88e5e33245c49d8;hb=HEAD;hp=1b5e7cdb84ed9e098cd0f0dfff71931bbbb48ec0;hpb=b84b6a91b0b3ddc586ca66fa774d7a11c31a8e54;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 1b5e7cdb8..4c7ce5ab4 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -304,6 +304,8 @@ void turret_respawn(entity this) Turret tur = get_turretinfo(this.m_id); tur.tr_setup(tur, this); + + setorigin(this, this.origin); // make sure it's linked to the area grid } @@ -693,7 +695,8 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl if(!e_target) return -2; - if(e_target.owner == e_turret) + // Don't attack against owner + if(e_target.owner == e_turret || e_target == e_turret.realowner) return -0.5; if(!checkpvs(e_target.origin, e_turret)) @@ -1245,9 +1248,9 @@ void turret_initparams(entity tur) #undef TRY } -bool turret_closetotarget(entity this, vector targ) +bool turret_closetotarget(entity this, vector targ, float range) { - vector path_extra_size = '64 64 64'; + vector path_extra_size = '1 1 1' * range; return boxesoverlap(targ - path_extra_size, targ + path_extra_size, this.absmin - path_extra_size, this.absmax + path_extra_size); } @@ -1296,7 +1299,7 @@ bool turret_initialize(entity this, Turret tur) } if(!(this.spawnflags & TSF_SUSPENDED)) - droptofloor(this); + DropToFloor_QC_DelayedInit(this); this.netname = tur.netname; load_unit_settings(this, 0);