]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Port buttons_old to ClientState
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 7f5ffaf79bd64688327c5e24b1e5cd79dc539642..e0e6bb62d2fd12fbbfb76eabfc734e7af8769d36 100644 (file)
@@ -273,8 +273,8 @@ bool frag_centermessage_override(entity attacker, entity targ, int deathtype, in
 {
        if(deathtype == DEATH_FIRE.m_id)
        {
-               Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : targ.ping));
-               Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping));
+               Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping));
+               Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping));
                return true;
        }
 
@@ -417,7 +417,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                                        CHOICE_TYPEFRAG,
                                        targ.netname,
                                        kill_count_to_attacker,
-                                       (IS_BOT_CLIENT(targ) ? -1 : targ.ping)
+                                       (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping)
                                );
                                Send_Notification(
                                        NOTIF_ONE,
@@ -428,7 +428,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                                        kill_count_to_target,
                                        attacker.health,
                                        attacker.armorvalue,
-                                       (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
+                                       (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping)
                                );
                        }
                        else if(!frag_centermessage_override(attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target))
@@ -440,7 +440,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                                        CHOICE_FRAG,
                                        targ.netname,
                                        kill_count_to_attacker,
-                                       (IS_BOT_CLIENT(targ) ? -1 : targ.ping)
+                                       (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping)
                                );
                                Send_Notification(
                                        NOTIF_ONE,
@@ -451,7 +451,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                                        kill_count_to_target,
                                        attacker.health,
                                        attacker.armorvalue,
-                                       (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
+                                       (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping)
                                );
                        }
 
@@ -618,20 +618,14 @@ void Unfreeze (entity targ)
 
 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
-       float mirrordamage;
-       float mirrorforce;
        float complainteamdamage = 0;
-       entity attacker_save;
-       mirrordamage = 0;
-       mirrorforce = 0;
+       float mirrordamage = 0;
+       float mirrorforce = 0;
 
        if (game_stopped || targ.killcount == FRAGS_SPECTATOR)
                return;
 
-    damage_targ = targ;
-    damage_inflictor = inflictor;
-    damage_attacker = attacker;
-       attacker_save = attacker;
+       entity attacker_save = attacker;
 
        // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
        if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))