]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use another switch
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 21:25:50 +0000 (00:25 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 21:25:50 +0000 (00:25 +0300)
qcsrc/server/mutators/sandbox.qc

index 0b472ad6ac689ccfb5b7b0f2bc983c76d831382d..0c73c463b1c61c540a839adb14e68df8055755c5 100644 (file)
@@ -198,12 +198,20 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                        e.frame = stof(argv(3));
                                                        break;
                                                case "physics":
-                                                       if(argv(3) == "0") // static
-                                                               e.movetype = MOVETYPE_NONE;
-                                                       else if(argv(3) == "1") // movable
-                                                               e.movetype = MOVETYPE_TOSS;
-                                                       else if(argv(3) == "2") // physical
-                                                               e.movetype = MOVETYPE_PHYSICS;
+                                                       switch(argv(3))
+                                                       {
+                                                               case "0": // static
+                                                                       e.movetype = MOVETYPE_NONE;
+                                                                       break;
+                                                               case "1": // movable
+                                                                       e.movetype = MOVETYPE_TOSS;
+                                                                       break;
+                                                               case "2": // physical
+                                                                       e.movetype = MOVETYPE_PHYSICS;
+                                                                       break;
+                                                               default:
+                                                                       break;
+                                                       }
                                                        break;
                                                default:
                                                        print_to(self, "WARNING: Invalid object property. For usage information, type 'sandbox help'");