]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Change some things in the attachment system
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 14:02:18 +0000 (17:02 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 14:02:18 +0000 (17:02 +0300)
qcsrc/server/mutators/sandbox.qc

index 077952db57de6eaeb90af4034867ed33c645442a..ff98edbf260ee42ef6997dcc9df370357f572bc8 100644 (file)
@@ -82,7 +82,6 @@ void sandbox_AttachObject_Set(entity e, entity parent, string s)
        e.solid = SOLID_NOT;
        e.takedamage = DAMAGE_NO;
 
-       setorigin(e, parent.origin);
        setattachment(e, parent, s);
        e.owner = parent;
 }
@@ -101,8 +100,11 @@ void sandbox_AttachObject_Remove(entity e)
                        head.takedamage = DAMAGE_AIM;
 
                        setattachment(head, world, "");
-                       setorigin(head, e.origin); // prevents a bug
                        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;
                }
        }
 }