X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Ftracing.qh;h=b2ab7d08222d64b81be935e746e31fab99844766;hb=59f99f0c8e51847ac5ff91ab338314fa84ea4737;hp=f6fa2045225e07bbdb51d7bf64d4b7acf7e4e701;hpb=6dbd7df3800a44792bcdeed57a9495c786ce9250;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index f6fa20452..b2ab7d082 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -1,4 +1,5 @@ -.float antilag_debug; +#ifndef TRACING_H +#define TRACING_H vector w_shotorg; vector w_shotdir; @@ -22,27 +23,26 @@ float mspercallsum; float mspercallsstyle; float mspercallcount; #endif -void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute); -void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread); /* WEAPONTODO -{ - W_SetupProjectileVelocityEx(missile, w_shotdir, v_up, pSpeed, 0, 0, spread, FALSE); -}*/ +void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute); -#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"), FALSE) -#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"), FALSE) +#define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, false) -#define WEP_SETUPPROJVELOCITY_UP_MO_NONE(ent,wepname,unused) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, speed), WEP_CVAR(wepname, speed_up), WEP_CVAR(wepname, speed_z), WEP_CVAR(wepname, spread), FALSE) -#define WEP_SETUPPROJVELOCITY_UP_MO_PRI(ent,wepname,unused) W_SetupProjectileVelocityEx(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 WEP_SETUPPROJVELOCITY_UP_MO_SEC(ent,wepname,unused) W_SetupProjectileVelocityEx(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 WEP_SETUPPROJVELOCITY_UP_MO_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(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 WEP_SETUPPROJVELOCITY_UP(ent,wepname,mode,isprimary) WEP_SETUPPROJVELOCITY_UP_##mode(ent, wepname, isprimary) +#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 WEP_SETUPPROJVELOCITY_MO_NONE(ent,wepname,unused) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, speed), 0, 0, WEP_CVAR(wepname, spread), FALSE) -#define WEP_SETUPPROJVELOCITY_MO_PRI(ent,wepname,unused) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE) -#define WEP_SETUPPROJVELOCITY_MO_SEC(ent,wepname,unused) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE) -#define WEP_SETUPPROJVELOCITY_MO_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE) -#define WEP_SETUPPROJVELOCITY(ent,wepname,mode,isprimary) WEP_SETUPPROJVELOCITY_##mode(ent, wepname, isprimary) +#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) \ + if(isprimary) { W_SetupProjVelocity_PRI(ent, wepname); } \ + else { W_SetupProjVelocity_SEC(ent, wepname); } // ==================== // Ballistics Tracing @@ -50,34 +50,10 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread); /* W .float railgundistance; .vector railgunforce; -void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype); - -.float dmg_force; -.float dmg_radius; -.float dmg_total; -//.float last_yoda; -void W_BallisticBullet_Hit (void); - -.void(void) W_BallisticBullet_LeaveSolid_think_save; -.float W_BallisticBullet_LeaveSolid_nextthink_save; -.vector W_BallisticBullet_LeaveSolid_origin; -.vector W_BallisticBullet_LeaveSolid_velocity; - -void W_BallisticBullet_LeaveSolid_think(); - -float W_BallisticBullet_LeaveSolid(float eff); +void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype); -void W_BallisticBullet_Touch (void); - -void endFireBallisticBullet(); /* WEAPONTODO -{ - endzcurveparticles(); -}*/ - -entity fireBallisticBullet_trace_callback_ent; -float fireBallisticBullet_trace_callback_eff; -void fireBallisticBullet_trace_callback(vector start, vector hit, vector end); - -void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant); - -void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer); +float fireBullet_trace_callback_eff; +entity fireBullet_last_hit; +void fireBullet_trace_callback(vector start, vector hit, vector end); +void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects); +#endif