Convert some more floats to ints/bools
authorMario <zacjardine@y7mail.com>
Fri, 1 May 2015 11:53:37 +0000 (21:53 +1000)
committerMario <zacjardine@y7mail.com>
Fri, 1 May 2015 11:53:37 +0000 (21:53 +1000)
qcsrc/common/physics.qc
qcsrc/common/triggers/func/door.qh

index 84b327c..0d723c3 100644 (file)
@@ -467,7 +467,7 @@ When you press the jump key
 returns true if handled
 =============
 */
-float PlayerJump (void)
+bool PlayerJump (void)
 {
        if (PHYS_FROZEN(self))
                return true; // no jumping in freezetag when frozen
@@ -603,7 +603,11 @@ void CheckWaterJump()
                        self.velocity_z = 225;
                        self.flags |= FL_WATERJUMP;
                        SET_JUMP_HELD(self);
+#ifdef SVQC
                        self.teleport_time = time + 2;  // safety net
+#elif defined(CSQC)
+                       pmove_waterjumptime = time + 2;
+#endif
                }
        }
 }
@@ -1571,7 +1575,7 @@ bool IsFlying(entity a)
 
 void PM_Main()
 {
-       float buttons = PHYS_INPUT_BUTTON_MASK(self);
+       int buttons = PHYS_INPUT_BUTTON_MASK(self);
 #ifdef CSQC
        self.items = getstati(STAT_ITEMS, 0, 24);
 
@@ -1618,7 +1622,7 @@ void PM_Main()
                        self.parm_idlesince = time;
        }
 #endif
-       float buttons_prev = self.buttons_old;
+       int buttons_prev = self.buttons_old;
        self.buttons_old = buttons;
        self.movement_old = self.movement;
        self.v_angle_old = self.v_angle;
@@ -1643,14 +1647,14 @@ void PM_Main()
                                self.race_penalty = 0;
 #endif
 
-               float not_allowed_to_move = 0;
+               bool not_allowed_to_move = false;
 #ifdef SVQC
                if (self.race_penalty)
-                       not_allowed_to_move = 1;
+                       not_allowed_to_move = true;
 #endif
 #ifdef SVQC
                if (time < game_starttime)
-                       not_allowed_to_move = 1;
+                       not_allowed_to_move = true;
 #endif
 
                if (not_allowed_to_move)
index b58091b..e91061f 100644 (file)
@@ -1,12 +1,12 @@
 // door constants
-const float DOOR_START_OPEN = 1;
-const float DOOR_DONT_LINK = 4;
-const float DOOR_TOGGLE = 32;
+const int DOOR_START_OPEN = 1;
+const int DOOR_DONT_LINK = 4;
+const int DOOR_TOGGLE = 32;
 
-const float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
+const int DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
 
-const float SPAWNFLAGS_GOLD_KEY = 8;
-const float SPAWNFLAGS_SILVER_KEY = 16;
+const int SPAWNFLAGS_GOLD_KEY = 8;
+const int SPAWNFLAGS_SILVER_KEY = 16;
 
 #ifdef CSQC
 // stuff for preload