From: Mircea Kitsune Date: Sun, 4 Dec 2011 16:54:32 +0000 (+0200) Subject: Fix a bug with persisted solidity when attaching / detaching objects X-Git-Tag: xonotic-v0.6.0~35^2~15^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6544dc13eebbed657a3ed01780b79c1444b2fd63;p=xonotic%2Fxonotic-data.pk3dir.git Fix a bug with persisted solidity when attaching / detaching objects --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 8b3a9596d..59d9fba23 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -70,14 +70,18 @@ entity sandbox_ObjectEdit_Get(float permissions) // objects temporarily solid while doing the trace, then revert them to their initial solidity. for(head = world; (head = find(head, classname, "object")); ) { - head.old_solid = head.solid; - head.solid = SOLID_BBOX; + if(head.owner == world) // skip attached objects + { + head.old_solid = head.solid; + head.solid = SOLID_BBOX; + } } makevectors(self.v_angle); WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * autocvar_g_sandbox_editor_distance_edit, MOVE_NORMAL, self); for(head = world; (head = find(head, classname, "object")); ) { - head.solid = head.old_solid; + if(head.owner == world) // skip attached objects + head.solid = head.old_solid; } if(trace_ent.classname != "object") @@ -130,10 +134,6 @@ void sandbox_ObjectAttach_Remove(entity e) if(head.owner == e) { vector org; - head.solid = head.old_solid; // restore persisted solidity - head.movetype = head.old_movetype; // restore persisted physics - head.takedamage = DAMAGE_AIM; - org = gettaginfo(head, 0); setattachment(head, world, ""); head.owner = world; @@ -141,6 +141,10 @@ void sandbox_ObjectAttach_Remove(entity e) // 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 + + head.solid = head.old_solid; // restore persisted solidity + head.movetype = head.old_movetype; // restore persisted physics + head.takedamage = DAMAGE_AIM; } } }