]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/sv_turrets.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / sv_turrets.qc
index 2e6068bf56ac823cbefc287b163941447c19a7b8..4c7ce5ab418a7bb6567ee2b6bcaeef2da5fc5f50 100644 (file)
@@ -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))
@@ -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);