X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Ftracing.qc;h=b82095a69971beaa49e6be3a86e07f2e760dc71a;hp=9fd07eb2e4920b4e5bd79542b7ebb07bd51ec5fb;hb=67610c5b92e218cc245c040209c1a79ab6b02758;hpb=42a881cbe552bb6ce4a13106cafc9d2f1a8152de diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 9fd07eb2e..b82095a69 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -7,8 +7,10 @@ #include "hitplot.qh" #include "weaponsystem.qh" -#include "../g_damage.qh" -#include "../antilag.qh" +#include "../damage.qh" +#include +#include +#include #include #include @@ -195,7 +197,7 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p mspercallsum -= gettime(GETTIME_HIRES); #endif - dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style); + dir = W_CalculateSpread(dir, spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style); #if 0 mspercallsum += gettime(GETTIME_HIRES); @@ -300,7 +302,7 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector msg_entity = it; // we want this to be very loud when close but fall off quickly -> using max base volume and high attenuation - soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, SND(NEXWHOOSH_RANDOM()), VOL_BASEVOICE, ATTEN_IDLE); + soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, SND(NEXWHOOSH_RANDOM()), VOL_BASEVOICE, ATTEN_IDLE, 0); }); if(pseudoprojectile) delete(pseudoprojectile); @@ -498,3 +500,44 @@ void fireBullet(entity this, .entity weaponentity, vector start, vector dir, flo { fireBullet_antilag(this, weaponentity, start, dir, spread, max_solid_penetration, damage, headshot_multiplier, force, dtype, tracer_effect, true); } + +void crosshair_trace(entity pl) +{ + traceline_antilag(pl, CS(pl).cursor_trace_start, CS(pl).cursor_trace_start + normalize(CS(pl).cursor_trace_endpos - CS(pl).cursor_trace_start) * max_shot_distance, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl)); +} + +void crosshair_trace_plusvisibletriggers(entity pl) +{ + crosshair_trace_plusvisibletriggers__is_wz(pl, false); +} + +void WarpZone_crosshair_trace_plusvisibletriggers(entity pl) +{ + crosshair_trace_plusvisibletriggers__is_wz(pl, true); +} + +void crosshair_trace_plusvisibletriggers__is_wz(entity pl, bool is_wz) +{ + FOREACH_ENTITY_FLOAT(solid, SOLID_TRIGGER, + { + if(it.model != "") + { + it.solid = SOLID_BSP; + IL_PUSH(g_ctrace_changed, it); + } + }); + + if (is_wz) + WarpZone_crosshair_trace(pl); + else + crosshair_trace(pl); + + IL_EACH(g_ctrace_changed, true, { it.solid = SOLID_TRIGGER; }); + + IL_CLEAR(g_ctrace_changed); +} + +void WarpZone_crosshair_trace(entity pl) +{ + WarpZone_traceline_antilag(pl, CS(pl).cursor_trace_start, CS(pl).cursor_trace_start + normalize(CS(pl).cursor_trace_endpos - CS(pl).cursor_trace_start) * max_shot_distance, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl)); +}