From b5dca4b47b21014868e29fbbd510c9fa735f7fde Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 1 May 2015 21:53:37 +1000 Subject: [PATCH] Convert some more floats to ints/bools --- qcsrc/common/physics.qc | 16 ++++++++++------ qcsrc/common/triggers/func/door.qh | 12 ++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 84b327c22..0d723c33a 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -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) diff --git a/qcsrc/common/triggers/func/door.qh b/qcsrc/common/triggers/func/door.qh index b58091b0a..e91061f14 100644 --- a/qcsrc/common/triggers/func/door.qh +++ b/qcsrc/common/triggers/func/door.qh @@ -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 -- 2.39.2