]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Use STAT(FROZEN, e) instead of e.frozen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 61ece1f59c9b05daf250ba25378979f91c0e53a5..32cd8c18450b5fbed3ddf73c7804406500926b17 100644 (file)
@@ -496,7 +496,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
 
 void Ice_Think()
 {SELFPARAM();
-       if(!self.owner.frozen || self.owner.iceblock != self)
+       if(!STAT(FROZEN, self.owner) || self.owner.iceblock != self)
        {
                remove(self);
                return;
@@ -510,12 +510,12 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
                return;
 
-       if(targ.frozen)
+       if(STAT(FROZEN, targ))
                return;
 
        float targ_maxhealth = ((IS_MONSTER(targ)) ? targ.max_health : start_health);
 
-       targ.frozen = frozen_type;
+       STAT(FROZEN, targ) = frozen_type;
        targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
        targ.health = ((frozen_type == 3) ? targ_maxhealth : 1);
        targ.revive_speed = freeze_time;
@@ -547,13 +547,13 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
-       if(!targ.frozen)
+       if(!STAT(FROZEN, targ))
                return;
 
-       if(targ.frozen && targ.frozen != 3) // only reset health if target was frozen
+       if(STAT(FROZEN, targ) && STAT(FROZEN, targ) != 3) // only reset health if target was frozen
                targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health);
 
-       targ.frozen = 0;
+       STAT(FROZEN, targ) = 0;
        targ.revive_progress = 0;
        targ.revival_time = time;
        self.bot_attack = true;
@@ -696,7 +696,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                mirrordamage = frag_mirrordamage;
                force = frag_force;
 
-               if(targ.frozen)
+               if(STAT(FROZEN, targ))
                if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id)
                {
                        if(autocvar_g_frozen_revive_falldamage > 0)
@@ -714,7 +714,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        force *= autocvar_g_frozen_force;
                }
 
-               if(targ.frozen && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_frozen_damage_trigger)
+               if(STAT(FROZEN, targ) && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_frozen_damage_trigger)
                {
                        Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1);
 
@@ -791,7 +791,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
 
                        if(IS_PLAYER(victim) || (IS_TURRET(victim) && victim.active == ACTIVE_ACTIVE) || IS_MONSTER(victim) || MUTATOR_CALLHOOK(PlayHitsound, victim))
                        {
-                               if(DIFF_TEAM(victim, attacker) && !victim.frozen)
+                               if(DIFF_TEAM(victim, attacker) && !STAT(FROZEN, victim))
                                {
                                        if(damage > 0)
                                        {
@@ -1211,7 +1211,7 @@ void Fire_ApplyDamage(entity e)
                e.fire_endtime = 0;
 
        // ice stops fire
-       if(e.frozen)
+       if(STAT(FROZEN, e))
                e.fire_endtime = 0;
 
        t = min(frametime, e.fire_endtime - time);
@@ -1228,7 +1228,7 @@ void Fire_ApplyDamage(entity e)
        e.fire_hitsound = true;
 
        if(!IS_INDEPENDENT_PLAYER(e))
-       if(!e.frozen)
+       if(!STAT(FROZEN, e))
                FOREACH_CLIENT(IS_PLAYER(it) && it != e, LAMBDA(
                        if(!IS_DEAD(it))
                        if(!IS_INDEPENDENT_PLAYER(it))