]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/hitplot.qc
assert_once
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / hitplot.qc
index 58ada70ad1cd0ce9f7b70378f3aada68cc4ea632..ec48c6d3cea09c19bb6498cc9f1c47691c7aad4c 100644 (file)
@@ -1,21 +1,15 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "hitplot.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../antilag.qh"
-#endif
+#include "hitplot.qh"
+
+#include "../antilag.qh"
+#include "../g_subs.qh"
+#include "../../common/weapons/all.qh"
 
 vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v)
 {
        vector ret;
-       ret_x = screenright * v;
-       ret_y = screenup * v;
-       ret_z = screenforward * v;
+       ret.x = screenright * v;
+       ret.y = screenup * v;
+       ret.z = screenforward * v;
        return ret;
 }
 
@@ -38,8 +32,8 @@ vector W_HitPlotNormalizedUntransform(vector org, entity targ, vector screenforw
                thisv = W_HitPlotUnnormalizedUntransform(screenforward, screenright, screenup, thisv);
                if(i || j || k)
                {
-                       if(mi.x > thisv.x) mi_x = thisv.x; if(ma.x < thisv.x) ma_x = thisv.x;
-                       if(mi.y > thisv.y) mi_y = thisv.y; if(ma.y < thisv.y) ma_y = thisv.y;
+                       if(mi.x > thisv.x) mi.x = thisv.x; if(ma.x < thisv.x) ma.x = thisv.x;
+                       if(mi.y > thisv.y) mi.y = thisv.y; if(ma.y < thisv.y) ma.y = thisv.y;
                        //if(mi_z > thisv_z) mi_z = thisv_z; if(ma_z < thisv_z) ma_y = thisv_z;
                }
                else
@@ -50,9 +44,9 @@ vector W_HitPlotNormalizedUntransform(vector org, entity targ, vector screenforw
        }
 
        thisv = W_HitPlotUnnormalizedUntransform(screenforward, screenright, screenup, v);
-       ret_x = (thisv.x - mi.x) / (ma.x - mi.x);
-       ret_y = (thisv.y - mi.y) / (ma.y - mi.y);
-       ret_z = thisv.z - myv.z;
+       ret.x = (thisv.x - mi.x) / (ma.x - mi.x);
+       ret.y = (thisv.y - mi.y) / (ma.y - mi.y);
+       ret.z = thisv.z - myv.z;
        return ret;
 }
 
@@ -72,7 +66,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright,
 
                org = player.origin + player.view_ofs;
                traceline_antilag_force(player, org, org + screenforward * MAX_SHOT_DISTANCE, MOVE_NORMAL, player, lag);
-               if(IS_CLIENT(trace_ent) || (trace_ent.flags & FL_MONSTER))
+               if(IS_CLIENT(trace_ent) || IS_MONSTER(trace_ent))
                {
                        antilag_takeback(trace_ent, time - lag);
                        hitplot = W_HitPlotNormalizedUntransform(org, trace_ent, screenforward, screenright, screenup, trace_endpos);
@@ -85,7 +79,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright,
 
 void W_HitPlotOpen(entity player)
 {
-       if(autocvar_g_hitplots || strstrofs(strcat(" ", autocvar_g_hitplots_individuals, " "), strcat(" ", player.netaddress, " "), 0) >= 0)
+       if(autocvar_g_hitplots || strhasword(autocvar_g_hitplots_individuals, player.netaddress))
        {
                player.hitplotfh = fopen(strcat("hits-", matchid, "-", player.netaddress, "-", ftos(player.playerid), ".plot"), FILE_WRITE);
                fputs(player.hitplotfh, strcat("#name ", player.netname, "\n"));