From: Mircea Kitsune Date: Tue, 25 Oct 2011 21:25:50 +0000 (+0300) Subject: Use another switch X-Git-Tag: xonotic-v0.6.0~35^2~18^2~163 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=acd177420875786e848b565fdff763c44f8277eb;p=xonotic%2Fxonotic-data.pk3dir.git Use another switch --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 0b472ad6a..0c73c463b 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -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'");