X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fwarpzone%2Fcommon.qc;h=03248ec50cca3943128c2cfa59ba6fb9ae4037ee;hb=905ec2fbd2b610eeb2591cdddbf71ce24b7bb3ab;hp=5acacc7734d47953601c3fd385fa35b2f86497e4;hpb=8ba1f6c672361186033b8bebc3be677ac94bd4da;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 5acacc773..03248ec50 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -4,7 +4,7 @@ #include #elif defined(MENUQC) #elif defined(SVQC) - #include + #include #endif void WarpZone_Accumulator_Clear(entity acc) @@ -112,7 +112,7 @@ float WarpZoneLib_BoxTouchesBrush_Recurse() #ifdef CSQC if (trace_networkentity) { - LOG_TRACE("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush\n"); + LOG_TRACE("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush"); // we cannot continue, as a player blocks us... // so, abort return 0; @@ -154,31 +154,33 @@ float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig) entity WarpZone_Find(vector mi, vector ma) { // if we are near any warpzone planes - MOVE AWAY (work around nearclip) - entity e; if(!warpzone_warpzones_exist) return NULL; - for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) - if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL)) - return e; + IL_EACH(g_warpzones, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL), + { + return it; + }); return NULL; } void WarpZone_MakeAllSolid() { - entity e; if(!warpzone_warpzones_exist) return; - for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) - e.solid = SOLID_BSP; + IL_EACH(g_warpzones, true, + { + it.solid = SOLID_BSP; + }); } void WarpZone_MakeAllOther() { - entity e; if(!warpzone_warpzones_exist) return; - for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) - e.solid = SOLID_TRIGGER; + IL_EACH(g_warpzones, true, + { + it.solid = SOLID_TRIGGER; + }); } void WarpZone_Trace_InitTransform() @@ -271,7 +273,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, { if(--i < 1) { - LOG_TRACE("Too many warpzones in sequence, aborting trace.\n"); + LOG_TRACE("Too many warpzones in sequence, aborting trace."); trace_ent = NULL; break; } @@ -296,13 +298,13 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, } break; } - if(trace_ent == wz) + /*if(trace_ent == wz) { // FIXME can this check be removed? Do we really need it? - LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n"); + LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace"); trace_ent = NULL; break; - } + }*/ wz = trace_ent; if(!WarpZone_trace_firstzone) WarpZone_trace_firstzone = wz; @@ -395,7 +397,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo { if(--i < 1) { - LOG_TRACE("Too many warpzones in sequence, aborting trace.\n"); + LOG_TRACE("Too many warpzones in sequence, aborting trace."); trace_ent = NULL; break; } @@ -413,7 +415,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo if(trace_ent == wz) { // FIXME can this check be removed? Do we really need it? - LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n"); + LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace"); trace_ent = NULL; break; } @@ -573,12 +575,9 @@ bool WarpZoneLib_BadEntity(entity e) { if (is_pure(e)) return true; string s = e.classname; - switch (s) - { - // case "net_linked": // actually some real entities are linked without classname, fail - case "": - return true; - } + + //if (s == "net_linked") return true; // actually some real entities are linked without classname, fail + if (s == "") return true; if (startsWith(s, "target_")) return true; @@ -671,7 +670,7 @@ void WarpZone_RefSys_GC(entity this) // garbage collect unused reference systems this.nextthink = time + 1; if(this.owner.WarpZone_refsys != this) - remove(this); + delete(this); } void WarpZone_RefSys_CheckCreate(entity me) { @@ -688,7 +687,7 @@ void WarpZone_RefSys_Clear(entity me) { if(me.WarpZone_refsys) { - remove(me.WarpZone_refsys); + delete(me.WarpZone_refsys); me.WarpZone_refsys = NULL; } }