From: Mircea Kitsune Date: Fri, 28 Oct 2011 19:09:34 +0000 (+0300) Subject: Don't allow attaching to attachments, for obvious reasons. Also don't persist the... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~69 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b7a295e6fe444ae6176c5ba1e43f32e477620ca;p=xonotic%2Fxonotic-data.pk3dir.git 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) --- 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;