]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/hitplot.qc
Merge branch 'master' into Mario/entrap_nade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / hitplot.qc
index ec48c6d3cea09c19bb6498cc9f1c47691c7aad4c..ec1fd089b1abd6cfeaf7fae56bf9d7546e975b0e 100644 (file)
@@ -2,7 +2,8 @@
 
 #include "../antilag.qh"
 #include "../g_subs.qh"
-#include "../../common/weapons/all.qh"
+#include <common/weapons/all.qh>
+#include <common/state.qh>
 
 vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v)
 {
@@ -68,10 +69,11 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright,
                traceline_antilag_force(player, org, org + screenforward * MAX_SHOT_DISTANCE, MOVE_NORMAL, player, lag);
                if(IS_CLIENT(trace_ent) || IS_MONSTER(trace_ent))
                {
-                       antilag_takeback(trace_ent, time - lag);
+                   entity store = IS_CLIENT(trace_ent) ? CS(trace_ent) : trace_ent;
+                       antilag_takeback(trace_ent, store, time - lag);
                        hitplot = W_HitPlotNormalizedUntransform(org, trace_ent, screenforward, screenright, screenup, trace_endpos);
-                       antilag_restore(trace_ent);
-                       fputs(player.hitplotfh, strcat(ftos(hitplot.x), " ", ftos(hitplot.y), " ", ftos(hitplot.z), " ", ftos(player.switchweapon), "\n"));
+                       antilag_restore(trace_ent, store);
+                       fputs(player.hitplotfh, strcat(ftos(hitplot.x), " ", ftos(hitplot.y), " ", ftos(hitplot.z), " ", ftos(PS(player).m_switchweapon.m_id), "\n"));
                        //print(strcat(ftos(hitplot_x), " ", ftos(hitplot_y), " ", ftos(hitplot_z), "\n"));
                }
        }