]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
useless change, will delete the branch again
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 338204c0c3a2cf30ba72cd7fff44b64b0e9d9c2d..505b2e7688a659d890b36faa422a41228ce66c61 100644 (file)
@@ -86,6 +86,15 @@ float IsFlying(entity a)
        return 1;
 }
 
+vector GetHeadshotMins(entity targ)
+{
+       return '0.6 0 0' * targ.mins_x + '0 0.6 0' * targ.mins_y + '0 0 1' * (1.3 * targ.view_ofs_z - 0.3 * targ.maxs_z);
+}
+vector GetHeadshotMaxs(entity targ)
+{
+       return '0.6 0 0' * targ.maxs_x + '0 0.6 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+}
+
 void UpdateFrags(entity player, float f)
 {
        PlayerTeamScore_AddScore(player, f);
@@ -149,6 +158,7 @@ void GiveFrags (entity attacker, entity targ, float f)
        entity oldself;
        oldself = self;
        self = attacker;
+       frag_attacker = attacker;
        frag_target = targ;
        frag_score = f;
        if(MUTATOR_CALLHOOK(GiveFragsForKill))
@@ -871,8 +881,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
                                vector headmins, headmaxs, org;
                                org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
-                               headmins = org + '0.6 0 0' * targ.mins_x + '0 0.6 0' * targ.mins_y + '0 0 1' * (1.3 * targ.view_ofs_z - 0.3 * targ.maxs_z);
-                               headmaxs = org + '0.6 0 0' * targ.maxs_x + '0 0.6 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+                               headmins = org + GetHeadshotMins(targ);
+                               headmaxs = org + GetHeadshotMaxs(targ);
                                if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
                                {
                                        deathtype |= HITTYPE_HEADSHOT;