]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename misleading DAMAGE_DEALT_TOTAL and damage_dealt to HITSOUND_DAMAGE_DEALT_TOTAL...
authorterencehill <piuntn@gmail.com>
Thu, 13 Jan 2022 22:04:04 +0000 (23:04 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 13 Jan 2022 22:04:04 +0000 (23:04 +0100)
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc
qcsrc/common/stats.qh
qcsrc/server/damage.qc
qcsrc/server/damage.qh
qcsrc/server/world.qc

index 4086e1b199ecb9ba31adc1a44c48045a084ba70c..34ba8595f050e97c8cbc75e911ed3d25b55fb4ee 100644 (file)
@@ -770,7 +770,7 @@ void UpdateDamage()
 {
        // accumulate damage with each stat update
        static float damage_total_prev = 0;
-       float damage_total = STAT(DAMAGE_DEALT_TOTAL);
+       float damage_total = STAT(HITSOUND_DAMAGE_DEALT_TOTAL);
        float unaccounted_damage_new = COMPARE_INCREASING(damage_total, damage_total_prev);
        damage_total_prev = damage_total;
 
index 44cd80d023d11f96d0c8ef81b3a0fe54b8ff1591..2abb0b5967483dcf11383b5b417bd367f89a6c29 100644 (file)
@@ -221,8 +221,8 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
                                armor -= 1;
                                SetResource(frag_target, RES_ARMOR, armor);
                                frag_damage = 0;
-                               frag_target.damage_dealt += 1;
-                               frag_attacker.damage_dealt += 1;
+                               frag_target.hitsound_damage_dealt += 1;
+                               frag_attacker.hitsound_damage_dealt += 1;
                                Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, armor);
                        }
                }
@@ -258,7 +258,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
                        armor -= 1;
                        SetResource(frag_attacker, RES_ARMOR, armor);
                        Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, armor);
-                       frag_attacker.damage_dealt += frag_mirrordamage;
+                       frag_attacker.hitsound_damage_dealt += frag_mirrordamage;
                }
                frag_mirrordamage = 0;
        }
index b30df3790a4da0073d3a6921a0336c4dd0387108..48dcb68b11dd0d6e00eef5a6ed279f76d3f31fb6 100644 (file)
@@ -25,7 +25,7 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink)
        if(autocvar_g_vampirehook_damage)
        {
                thehook.last_dmg = time + autocvar_g_vampirehook_damagerate;
-               thehook.owner.damage_dealt += autocvar_g_vampirehook_damage;
+               thehook.owner.hitsound_damage_dealt += autocvar_g_vampirehook_damage;
                Damage(dmgent, thehook, thehook.owner, autocvar_g_vampirehook_damage, WEP_HOOK.m_id, DMG_NOWEP, thehook.origin, '0 0 0');
                entity targ = ((SAME_TEAM(thehook.owner, thehook.aiment)) ? thehook.aiment : thehook.owner);
                // TODO: we can't do this due to an issue with globals and the mutator arguments
index 463d98c850157f9c595dd4e57759ce75fb57c60c..b02a013c05a48fb24c8195247ebdd0f639eaee83 100644 (file)
@@ -100,7 +100,7 @@ REGISTER_STAT(LEADLIMIT_AND_FRAGLIMIT, float, autocvar_leadlimit_and_fraglimit)
 REGISTER_STAT(LAST_PICKUP, float)
 REGISTER_STAT(HUD, int)
 REGISTER_STAT(HIT_TIME, float)
-REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
+REGISTER_STAT(HITSOUND_DAMAGE_DEALT_TOTAL, int)
 REGISTER_STAT(TYPEHIT_TIME, float)
 REGISTER_STAT(AIR_FINISHED, float)
 REGISTER_STAT(VEHICLESTAT_HEALTH, int)
index d480c229b9b244024d6efae2e81eccb30657657e..7a614bc87cf0d4503f59fb108e5e28a23854d23e 100644 (file)
@@ -790,7 +790,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                                                        if(PHYS_INPUT_BUTTON_CHAT(victim))
                                                                attacker.typehitsound += 1;
                                                        else
-                                                               attacker.damage_dealt += damage;
+                                                               attacker.hitsound_damage_dealt += damage;
                                                }
 
                                                impressive_hits += 1;
@@ -1197,12 +1197,12 @@ void Fire_ApplyDamage(entity e)
        t = min(frametime, fireendtime - time);
        d = e.fire_damagepersec * t;
 
-       hi = e.fire_owner.damage_dealt;
+       hi = e.fire_owner.hitsound_damage_dealt;
        ty = e.fire_owner.typehitsound;
        Damage(e, e, e.fire_owner, d, e.fire_deathtype, DMG_NOWEP, e.origin, '0 0 0');
        if(e.fire_hitsound && e.fire_owner)
        {
-               e.fire_owner.damage_dealt = hi;
+               e.fire_owner.hitsound_damage_dealt = hi;
                e.fire_owner.typehitsound = ty;
        }
        e.fire_hitsound = true;
index 3d6e024812ba4790abebe702e83b793d5af27d3f..19206daf368647fdf9555e52b24e991b10786171 100644 (file)
@@ -69,7 +69,8 @@ int impressive_hits;
 
 .vector death_origin;
 
-.float damage_dealt, typehitsound, killsound;
+.float hitsound_damage_dealt;
+.int typehitsound, killsound;
 
 // used for custom deathtype
 string deathmessage;
index 305aa305c63c5f60a18fbd80418fc66b0f74a0d0..e2a44d2c8b71e29d28a02138543ea4faf0f3f44a 100644 (file)
@@ -2294,11 +2294,10 @@ void EndFrame()
                        STAT(TYPEHIT_TIME, it) = time;
                } else if (e.killsound) {
                        STAT(KILL_TIME, it) = time;
-               } else if (e.damage_dealt) {
+               } else if (e.hitsound_damage_dealt) {
                        STAT(HIT_TIME, it) = time;
-                       // NOTE: total damage dealt stat is not accurate as client
-                       // code doesn't need so much accuracy for its purposes
-                       STAT(DAMAGE_DEALT_TOTAL, it) += ceil(e.damage_dealt);
+                       // NOTE: this is not accurate as client code doesn't need so much accuracy for its purposes
+                       STAT(HITSOUND_DAMAGE_DEALT_TOTAL, it) += ceil(e.hitsound_damage_dealt);
                }
        });
        // add 1 frametime because after this, engine SV_Physics
@@ -2309,7 +2308,7 @@ void EndFrame()
        float altime = time + frametime * (1 + autocvar_g_antilag_nudge);
        FOREACH_CLIENT(true, {
                it.typehitsound = false;
-               it.damage_dealt = 0;
+               it.hitsound_damage_dealt = 0;
                it.killsound = false;
                antilag_record(it, CS(it), altime);
        });