]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 60476213897854d537a9107f258b479bdd854d4c..aab2f9ced5567164b401596cfe34a70d4972491f 100644 (file)
@@ -18,7 +18,8 @@
     #include "../common/notifications.qh"
     #include "../common/deathtypes.qh"
     #include "mutators/mutators_include.qh"
-    #include "tturrets/include/turrets_early.qh"
+    #include "../common/turrets/turrets.qh"
+    #include "../common/turrets/sv_turrets.qh"
     #include "vehicles/vehicles_def.qh"
     #include "../csqcmodellib/sv_model.qh"
     #include "../common/playerstats.qh"
@@ -609,7 +610,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
                RemoveGrapplingHook(head);
 
        // add waypoint
-       if(show_waypoint)       
+       if(show_waypoint)
                WaypointSprite_Spawn("frozen", 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT, '0.25 0.90 1');
 }
 
@@ -622,9 +623,9 @@ void Unfreeze (entity targ)
        targ.frozen = 0;
        targ.revive_progress = 0;
        targ.revival_time = time;
-       
+
        WaypointSprite_Kill(targ.waypointsprite_attached);
-       
+
        FOR_EACH_PLAYER(head)
        if(head.hook.aiment == targ)
                RemoveGrapplingHook(head);
@@ -788,22 +789,22 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        damage = 0;
                        force *= autocvar_g_freezetag_frozen_force;
                }
-               
+
                if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger)
                {
                        pointparticles(particleeffectnum("teleport"), targ.origin, '0 0 0', 1);
-               
+
                        entity oldself = self;
                        self = targ;
                        entity spot = SelectSpawnPoint (false);
-                       
+
                        if(spot)
                        {
                                damage = 0;
                                self.deadflag = DEAD_NO;
 
                                self.angles = spot.angles;
-                               
+
                                self.effects = 0;
                                self.effects |= EF_TELEPORT_BIT;
 
@@ -814,16 +815,16 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                self.punchangle = '0 0 0';
                                self.punchvector = '0 0 0';
                                self.oldvelocity = self.velocity;
-                               
+
                                self.spawnorigin = spot.origin;
                                setorigin (self, spot.origin + '0 0 1' * (1 - self.mins.z - 24));
                                // don't reset back to last position, even if new position is stuck in solid
                                self.oldorigin = self.origin;
                                self.prevorigin = self.origin;
-                               
+
                                pointparticles(particleeffectnum("teleport"), self.origin, '0 0 0', 1);
                        }
-                       
+
                        self = oldself;
                }
 
@@ -865,7 +866,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        else
                                victim = targ;
 
-                       if(IS_PLAYER(victim) || (victim.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || (victim.flags & FL_MONSTER))
+                       if(IS_PLAYER(victim) || ((victim.turret_flags & TUR_FLAG_ISTURRET) && victim.active == ACTIVE_ACTIVE) || (victim.flags & FL_MONSTER))
                        {
                                if(DIFF_TEAM(victim, attacker) && !victim.frozen)
                                {