X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=7ed094cc3a616f6f4b91f0bbe5314e79273cf292;hb=9215008d87f1170da32befded6baeb55f3a2cf13;hp=a9d50e7ba9b51c7be0f5b90a10a23f45cd79a7fb;hpb=f2decf529cf30bb417b09c24cf6e7db5619135c6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index a9d50e7ba..7ed094cc3 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -40,29 +40,38 @@ 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)); } -.bool ctrace_solidchanged; + 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; - it.ctrace_solidchanged = true; IL_PUSH(g_ctrace_changed, it); } }); - crosshair_trace(pl); + if (is_wz) + WarpZone_crosshair_trace(pl); + else + crosshair_trace(pl); - IL_EACH(g_ctrace_changed, it.ctrace_solidchanged, - { - it.solid = SOLID_TRIGGER; - it.ctrace_solidchanged = false; - }); + 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)); @@ -219,7 +228,6 @@ string AmmoNameFromWeaponentity(Weapon wep) return ammoitems; } -.float old_solid; string formatmessage(entity this, string msg) { float p, p1, p2; @@ -253,19 +261,10 @@ string formatmessage(entity this, string msg) if (p < 0) break; - + if(!traced) { - IL_EACH(g_items, true, - { - it.old_solid = it.solid; - it.solid = SOLID_BSP; - }); - WarpZone_crosshair_trace(this); - IL_EACH(g_items, true, - { - it.solid = it.old_solid; - }); + WarpZone_crosshair_trace_plusvisibletriggers(this); cursor = trace_endpos; cursor_ent = trace_ent; traced = true; @@ -890,7 +889,7 @@ void remove_safely(entity e) builtin_remove(e); } -void InitializeEntity(entity e, void(entity this) func, float order) +void InitializeEntity(entity e, void(entity this) func, int order) { entity prev, cur;