]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Simplify physics saving code
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 29 Oct 2011 16:11:41 +0000 (19:11 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 29 Oct 2011 16:11:41 +0000 (19:11 +0300)
qcsrc/server/mutators/sandbox.qc

index e76f74020a059bb7c01314d3d7d43f561009d552..d508727bc06cbf3f1b8f56f85e11640bf3a7a929 100644 (file)
@@ -171,7 +171,6 @@ string sandbox_ObjectPort_Save(entity e, float database)
        {
                // the main object needs to be first in the array [0] with attached objects following
                float slot, physics;
-               string tagname;
                if(head == e) // this is the main object, place it first
                {
                        slot = 0;
@@ -182,10 +181,7 @@ string sandbox_ObjectPort_Save(entity e, float database)
                        i += 1; // children start from 1
                        slot = i;
                        physics = head.old_movetype; // persisted physics are normal physics for children
-
-                       // get the name of the tag our object is attached to
-                       gettaginfo(head.owner, head.tag_index);
-                       tagname = gettaginfo_name;
+                       gettaginfo(head.owner, head.tag_index); // get the name of the tag our object is attached to, used further below
                }
                else
                        continue;
@@ -194,7 +190,7 @@ string sandbox_ObjectPort_Save(entity e, float database)
                if(slot)
                {
                        // properties stored only for child objects
-                       if(tagname)     port_string[slot] = strcat(port_string[slot], "\"", tagname, "\" ");    else    port_string[slot] = strcat(port_string[slot], "- "); // none
+                       if(gettaginfo_name)     port_string[slot] = strcat(port_string[slot], "\"", gettaginfo_name, "\" ");    else    port_string[slot] = strcat(port_string[slot], "- "); // none
                }
                else
                {