]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
disallow removing crylink spikes if they are still referenced by players somehow
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 24 Aug 2011 10:08:04 +0000 (12:08 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 24 Aug 2011 10:08:04 +0000 (12:08 +0200)
qcsrc/server/miscfunctions.qc
qcsrc/server/w_crylink.qc

index 7a0257a068b33058814025f3419787e2e7d0c8fb..3bb6e6b7ca0d65d9472b1d905e67e870735a6b03 100644 (file)
@@ -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);
 }
 
index 05f381f3beabe4b4d09d0105bac0dc03d23bd907..0b11b69eec6430e1be93c658e4ca96e9148f142a 100644 (file)
@@ -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);
 }