From: Rudolf Polzer Date: Wed, 24 Aug 2011 10:08:04 +0000 (+0200) Subject: disallow removing crylink spikes if they are still referenced by players somehow X-Git-Tag: xonotic-v0.5.0~69 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c83485ba888a4ab64f8bc5b95130c27ae9cb469c;p=xonotic%2Fxonotic-data.pk3dir.git disallow removing crylink spikes if they are still referenced by players somehow --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 7a0257a06..3bb6e6b7c 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1754,6 +1754,8 @@ void remove_except_protected(entity e) void remove_unsafely(entity e) { + if(e.classname == "spike") + error("Removing spikes is forbidden (crylink bug), please report"); remove_builtin(e); } diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index 05f381f3b..0b11b69ee 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -16,7 +16,7 @@ void W_Crylink_CheckLinks(entity e) if(e == world) error("W_Crylink_CheckLinks: entity is world"); - if(e.classname != "spike") + if(e.classname != "spike" || wasfreed(e)) error(sprintf("W_Crylink_CheckLinks: entity is not a spike but a %s (freed: %d)", e.classname, wasfreed(e))); p = e; @@ -39,6 +39,7 @@ void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next) own.crylink_lastgroup = ((me == next) ? world : next); prev.queuenext = next; next.queueprev = prev; + me.classname = "spike_oktoremove"; if(me != next) W_Crylink_CheckLinks(next); } @@ -65,6 +66,7 @@ void W_Crylink_LinkExplode (entity e, entity e2) if(e.queuenext != e2) W_Crylink_LinkExplode(e.queuenext, e2); + e.classname = "spike_oktoremove"; remove (e); }