From: Mircea Kitsune Date: Sat, 29 Oct 2011 13:16:59 +0000 (+0300) Subject: Detach objects at exactly the same origin, not the origin of the parent. Angles howev... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~50 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bb80e6b375e0b757b0866d170c6b2e26c21e25b2;p=xonotic%2Fxonotic-data.pk3dir.git Detach objects at exactly the same origin, not the origin of the parent. Angles however are reset to the parent's, so that detached objects don't spin or roll --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 7de8f4cb0..8f595c059 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -85,16 +85,18 @@ void sandbox_ObjectAttach_Remove(entity e) { if(head.owner == e) { + vector org; head.movetype = MOVETYPE_TOSS; // default head.solid = SOLID_BBOX; head.takedamage = DAMAGE_AIM; + org = gettaginfo(head, 0); setattachment(head, world, ""); head.owner = world; - // objects reset origin and angles when detached, so apply the parent's to prevent teleporting - setorigin(head, e.origin); - head.angles = e.angles; + // objects change origin and angles when detached, so apply previous position + setorigin(head, org); + head.angles = e.angles; // don't allow detached objects to spin or roll } } }