]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply the previous physics of the object once it's detached, instead of reverting...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 14:12:36 +0000 (17:12 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 14:12:36 +0000 (17:12 +0300)
qcsrc/server/mutators/sandbox.qc

index ff98edbf260ee42ef6997dcc9df370357f572bc8..3eb421955d56f5a78ab89aa10025f6b59c73290c 100644 (file)
@@ -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;