From: Mircea Kitsune Date: Sun, 4 Dec 2011 20:34:47 +0000 (+0200) Subject: When removing sandbox objects, if the object being removed has been selected for... X-Git-Tag: xonotic-v0.6.0~35^2~15^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=478de1b4398362fef02c6f4443f756560bea514d;p=xonotic%2Fxonotic-data.pk3dir.git When removing sandbox objects, if the object being removed has been selected for attachment by a player, unset it --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index e12b98da3..66377d1d8 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -181,6 +181,14 @@ void sandbox_ObjectRemove(entity e) { sandbox_ObjectAttach_Remove(e); // detach child objects + // if the object being removed has been selected for attachment by a player, unset it + entity head; + FOR_EACH_REALPLAYER(head) // bots can't have objects + { + if(head.object_attach == e) + head.object_attach = world; + } + if(e.material) { strunzone(e.material); e.material = string_null; } if(e.crypto_idfp) { strunzone(e.crypto_idfp); e.crypto_idfp = string_null; } if(e.netname) { strunzone(e.netname); e.netname = string_null; }