]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qc
Cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qc
index 2fd3f9fb59eb94dccba55254e6ca6708a12b3fa3..f4e2d912c79eb4df6601b16021b24a4b10c9b708 100644 (file)
@@ -527,22 +527,18 @@ bool PM_check_specialcommand(entity this, int buttons)
 {
 #ifdef SVQC
        string c;
-       if (!buttons)
-               c = "x";
-       else if (buttons == 1)
-               c = "1";
-       else if (buttons == 4)
-               c = " ";
-       else if (buttons == 128)
-               c = "s";
-       else if (buttons == 256)
-               c = "w";
-       else if (buttons == 512)
-               c = "a";
-       else if (buttons == 1024)
-               c = "d";
-       else
-               c = "?";
+       switch (buttons)
+       {
+               // buttons mapped in PHYS_INPUT_BUTTON_MASK
+               case 0: c = "x"; break;
+               case BIT(0): c = "1"; break;
+               case BIT(2): c = " "; break;
+               case BIT(7): c = "s"; break;
+               case BIT(8): c = "w"; break;
+               case BIT(9): c = "a"; break;
+               case BIT(10): c = "d"; break;
+               default: c = "?";
+       }
 
        if (c == substring(specialcommand, CS(this).specialcommand_pos, 1))
        {