From 3b7a295e6fe444ae6176c5ba1e43f32e477620ca Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 28 Oct 2011 22:09:34 +0300 Subject: [PATCH] Don't allow attaching to attachments, for obvious reasons. Also don't persist the movetype of attachments, as it will not work with that I'm going to implement next (restore default physics when detaching an object) --- qcsrc/server/mutators/sandbox.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 96b29acab..2495fdb98 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -56,12 +56,13 @@ void sandbox_ObjectEdit_Scale(entity e, float f) } } -.float old_movetype; +void sandbox_ObjectAttach_Remove(entity e); void sandbox_ObjectAttach_Set(entity e, entity parent, string s) { // attaches e to parent on string s - e.old_movetype = e.movetype; // persist this + // we can't attach to an attachment, for obvious reasons + sandbox_ObjectAttach_Remove(e); e.movetype = MOVETYPE_FOLLOW; e.solid = SOLID_NOT; @@ -80,7 +81,7 @@ void sandbox_ObjectAttach_Remove(entity e) { if(head.owner == e) { - head.movetype = head.old_movetype; // revert to previous physics + head.movetype = MOVETYPE_TOSS; // default head.solid = SOLID_BBOX; head.takedamage = DAMAGE_AIM; -- 2.39.2