From: Mircea Kitsune Date: Thu, 27 Oct 2011 14:12:36 +0000 (+0300) Subject: Apply the previous physics of the object once it's detached, instead of reverting... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~118 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9eb375aa008bc0533bac2115f11bbf3ebad73ba9;p=xonotic%2Fxonotic-data.pk3dir.git Apply the previous physics of the object once it's detached, instead of reverting to default MOVETYPE_TOSS --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index ff98edbf2..3eb421955 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -74,10 +74,13 @@ void sandbox_EditObject_Scale(entity e, float f) } } +.float old_movetype; void sandbox_AttachObject_Set(entity e, entity parent, string s) { // attaches e to parent on string s + e.old_movetype = e.movetype; // persist this + e.movetype = MOVETYPE_FOLLOW; e.solid = SOLID_NOT; e.takedamage = DAMAGE_NO; @@ -95,7 +98,7 @@ void sandbox_AttachObject_Remove(entity e) { if(head.owner == e) { - head.movetype = MOVETYPE_TOSS; + head.movetype = e.old_movetype; // revert to previous physics head.solid = SOLID_BBOX; head.takedamage = DAMAGE_AIM;