]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't allow attaching to attachments, for obvious reasons. Also don't persist the...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 28 Oct 2011 19:09:34 +0000 (22:09 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 28 Oct 2011 19:09:34 +0000 (22:09 +0300)
qcsrc/server/mutators/sandbox.qc

index 96b29acabb5b28832889d240274cb8db9de99371..2495fdb9849ea619fc6458220e09edd0a937c701 100644 (file)
@@ -56,12 +56,13 @@ void sandbox_ObjectEdit_Scale(entity e, float f)
        }
 }
 
-.float old_movetype;
+void sandbox_ObjectAttach_Remove(entity e);
 void sandbox_ObjectAttach_Set(entity e, entity parent, string s)
 {
        // attaches e to parent on string s
 
-       e.old_movetype = e.movetype; // persist this
+       // we can't attach to an attachment, for obvious reasons
+       sandbox_ObjectAttach_Remove(e);
 
        e.movetype = MOVETYPE_FOLLOW;
        e.solid = SOLID_NOT;
@@ -80,7 +81,7 @@ void sandbox_ObjectAttach_Remove(entity e)
        {
                if(head.owner == e)
                {
-                       head.movetype = head.old_movetype; // revert to previous physics
+                       head.movetype = MOVETYPE_TOSS; // default
                        head.solid = SOLID_BBOX;
                        head.takedamage = DAMAGE_AIM;