]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move the check inside turret_validate_target main function and remove print_to functi...
authorLegendaryGuard <rootuser999@gmail.com>
Sun, 27 Nov 2022 12:10:42 +0000 (13:10 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Sun, 27 Nov 2022 12:10:42 +0000 (13:10 +0100)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/tesla.qc

index b0702e4b402e76729a0e88fba83491bc44cc37b4..5cace0f2f6606facb4cc9e96c66ec82004344a32 100644 (file)
@@ -729,7 +729,7 @@ void nade_tandem_spawnitem(entity e, vector org)
        if((IS_GAMETYPE(FREEZETAG) || IS_GAMETYPE(LMS)) 
                && (itm != ITEM_ArmorSmall || itm != ITEM_HealthSmall))
        {
-               print_to(e, "Non-regular items can't be spawned on survival-type gamemodes");
+               // Non-regular items can't be spawned on survival-type gamemodes
                itm = (random() > 0.5) ? ITEM_ArmorSmall : ITEM_HealthSmall;
        }
 
@@ -751,6 +751,7 @@ void nade_tandem_dropping(entity this, vector org)
        e.spawnfunc_checked = true;
        e.pokenade_type = this.pokenade_type;
 
+       // Items can't be spawned on CA and Instagib
        if(!IS_GAMETYPE(CA) && !autocvar_g_instagib)
        {
                switch (this.pokenade_type)
@@ -770,7 +771,6 @@ void nade_tandem_dropping(entity this, vector org)
                        default                 : { nade_tandem_spawnitem(e, org); return; }
                }
        }
-       else print_to(this, "Items can't be spawned on CA and Instagib");
 }
 
 void tandem_ball_think(entity this)
index 6b6c89e10650067aaebad39da2dd164f7c787100..c5ff8b31b6ec6394cfe13636fc26589b2f5379fb 100644 (file)
@@ -704,7 +704,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))
@@ -1033,7 +1034,7 @@ void turret_think(entity this)
        if(this.tur_spawned && this.turret_lifetime != 0)
        if(time >= this.turret_lifetime)
        {
-               tmp_vehcount--;
+               tmp_turcount--;
 
                turret_die(this);
                return;
@@ -1136,9 +1137,6 @@ void turret_think(entity this)
 
                // Check if we have a vailid enemy, and try to find one if we dont.
 
-               // Don't attack against owner
-               if(turret_select_target(this) == this.realowner) return;
-
                // g_turrets_targetscan_maxdelay forces a target re-scan at least this often
                float do_target_scan = 0;
                if((this.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
index 8984ead962951641c91ab77d39e8ae2aed095025..4c27bc9acce8cd112e0426e0062a0cceee1e115e 100644 (file)
@@ -57,9 +57,6 @@ bool turret_tesla_firecheck(entity this)
     if((this.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
         do_target_scan = 1;
 
-    if(turret_select_target(this) == this.realowner)
-        return false;
-
     // Old target (if any) invalid?
     if(this.target_validate_time < time)
     if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0)