X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fhitplot.qc;h=c93b319530b5df6407d9453a895b3e7106d553da;hb=5f9a104fb3f5ef5f8a68d671425290ea8a6f9843;hp=685741dabc0cf4be042412decea63555fe344ca7;hpb=b2bebff5bd5d111bb469de032d9b878d95f3c033;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/hitplot.qc b/qcsrc/server/weapons/hitplot.qc index 685741dab..c93b31953 100644 --- a/qcsrc/server/weapons/hitplot.qc +++ b/qcsrc/server/weapons/hitplot.qc @@ -1,9 +1,16 @@ +#include "hitplot.qh" +#include "../_all.qh" + +#include "../antilag.qh" +#include "../g_subs.qh" +#include "../../common/weapons/weapons.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; } @@ -20,14 +27,14 @@ vector W_HitPlotNormalizedUntransform(vector org, entity targ, vector screenforw for(i = 0; i < 2; ++i) for(j = 0; j < 2; ++j) for(k = 0; k < 2; ++k) { thisv = targ.origin; - if(i) thisv_x += targ.maxs_x; else thisv_x += targ.mins_x; - if(j) thisv_y += targ.maxs_y; else thisv_y += targ.mins_y; - if(k) thisv_z += targ.maxs_z; else thisv_z += targ.mins_z; + if(i) thisv.x += targ.maxs.x; else thisv.x += targ.mins.x; + if(j) thisv.y += targ.maxs.y; else thisv.y += targ.mins.y; + if(k) thisv.z += targ.maxs.z; else thisv.z += targ.mins.z; 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 @@ -38,9 +45,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; } @@ -65,7 +72,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright, antilag_takeback(trace_ent, 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")); + fputs(player.hitplotfh, strcat(ftos(hitplot.x), " ", ftos(hitplot.y), " ", ftos(hitplot.z), " ", ftos(player.switchweapon), "\n")); //print(strcat(ftos(hitplot_x), " ", ftos(hitplot_y), " ", ftos(hitplot_z), "\n")); } }