]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't multiply size with scale is scale is 0, causing the bounding box to become...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 11:04:31 +0000 (14:04 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 11:04:31 +0000 (14:04 +0300)
qcsrc/server/mutators/sandbox.qc

index 08439ea7beec99460662f5704787f0cadd501607..b1292263d3642c0af1efc079be271788aa7f7e7a 100644 (file)
@@ -186,11 +186,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                e.colormod = stov(argv(3));
                                e.glowmod = stov(argv(4));
                                e.frame = stof(argv(5));
-                               e.scale = stof(argv(6));        setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
+                               e.scale = stof(argv(6));        if(self.scale)  setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
                                e.movetype = stof(argv(7));
 
-dprint(strcat(argv(6), " --------\n"));
-
                                print_to(self, "Object pasted");
                                if(autocvar_g_sandbox_info)
                                        print(strcat(self.netname, " pasted an object at origin ", vtos(e.origin), "\n"));
@@ -227,7 +225,8 @@ dprint(strcat(argv(6), " --------\n"));
                                                        break;
                                                case "scale":
                                                        e.scale = stof(argv(3));
-                                                       setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
+                                                       if(self.scale)
+                                                               setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
                                                        break;
                                                case "physics":
                                                        switch(argv(3))