X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fhitplot.qc;fp=qcsrc%2Fserver%2Fweapons%2Fhitplot.qc;h=ec1004cd1dfc2c57d24545332853b7e030954499;hb=bb80a6aba067167c6ef8d5f3465f03bd34142fa2;hp=685741dabc0cf4be042412decea63555fe344ca7;hpb=a035d049951445f892a37bfdef3e738f8a18e8b9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/hitplot.qc b/qcsrc/server/weapons/hitplot.qc index 685741dab..ec1004cd1 100644 --- a/qcsrc/server/weapons/hitplot.qc +++ b/qcsrc/server/weapons/hitplot.qc @@ -1,9 +1,21 @@ +#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 + 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 +32,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 +50,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 +77,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")); } }