]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Attempt to make loaded child objects attached. Code is buggy any currently breaks...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 28 Oct 2011 20:30:12 +0000 (23:30 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 28 Oct 2011 20:30:12 +0000 (23:30 +0300)
qcsrc/server/mutators/sandbox.qc

index cad498b055b94ef4e5055abe5c2d4438680fd67d..e1f57d9de15e057a8cc257a58ac52b786ed4d33d 100644 (file)
@@ -193,7 +193,7 @@ entity sandbox_ObjectPort_Load(string s, float database)
 {
        // load object properties
        float n, i;
-       entity e;
+       entity e, parent;
 
        for(;;)
        {
@@ -218,6 +218,11 @@ entity sandbox_ObjectPort_Load(string s, float database)
                        e.angles = stov(argv(12));
                }
 
+               if(i > 0) // child object
+                       sandbox_ObjectAttach_Set(e, parent, "");
+               else // parent object
+                       parent = e;
+
                i += 1;
                if(i > n)
                        break;