From: Samual Lenks Date: Tue, 31 Dec 2013 13:29:49 +0000 (-0500) Subject: Final cleanup of SetupProjVelocity stuff :) X-Git-Tag: xonotic-v0.8.0~152^2~193 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0873ce4c52d2dd464f97014f9e972ffd5c3cfeb2;p=xonotic%2Fxonotic-data.pk3dir.git Final cleanup of SetupProjVelocity stuff :) --- diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index f94970698..433163d82 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -23,18 +23,25 @@ float mspercallsstyle; float mspercallcount; #endif -void W_SetupProjVelocity_Explicit(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute); +void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute); + #define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, FALSE) #define W_SetupProjVelocity_UP_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), FALSE) #define W_SetupProjVelocity_UP_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), FALSE) #define W_SetupProjVelocity_UP_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), FALSE) -#define W_SetupProjVelocity_UP_BOTH(ent,wepname,isprimary) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), WEP_CVAR_BOTH(wepname, isprimary, speed_up), WEP_CVAR_BOTH(wepname, isprimary, speed_z), WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE) + +#define W_SetupProjVelocity_UP_BOTH(ent,wepname,isprimary) \ + if(isprimary) { W_SetupProjVelocity_UP_PRI(ent, wepname); } \ + else { W_SetupProjVelocity_UP_SEC(ent, wepname); } #define W_SetupProjVelocity_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE) #define W_SetupProjVelocity_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE) #define W_SetupProjVelocity_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE) -#define W_SetupProjVelocity_BOTH(ent,wepname,isprimary) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE) + +#define W_SetupProjVelocity_BOTH(ent,wepname,isprimary) \ + if(isprimary) { W_SetupProjVelocity_PRI(ent, wepname); } \ + else { W_SetupProjVelocity_SEC(ent, wepname); } // ==================== // Ballistics Tracing