From 478de1b4398362fef02c6f4443f756560bea514d Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sun, 4 Dec 2011 22:34:47 +0200 Subject: [PATCH] When removing sandbox objects, if the object being removed has been selected for attachment by a player, unset it --- qcsrc/server/mutators/sandbox.qc | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.39.2