From c8f6e9084a329db9597364ee96006c7c427a82b6 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 24 Dec 2012 11:13:39 +0100 Subject: [PATCH] audit some .think use --- qcsrc/server/g_subs.qc | 5 ++--- qcsrc/server/g_triggers.qc | 2 ++ qcsrc/server/t_plats.qc | 13 ++++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 6c43c985f..fd34e9ee1 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -1,5 +1,4 @@ -float SUB_True() { return 1; } -float SUB_False() { return 0; } +void SUB_NullThink(void) { } void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; void() SUB_CalcMoveDone; @@ -279,7 +278,7 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() fu controller.think1 = self.think; // the thinking is now done by the controller - self.think = func_null; + self.think = SUB_NullThink; // for PushMove self.nextthink = self.ltime + traveltime; // invoke controller diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 10a78fb99..bf473fabb 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -255,6 +255,7 @@ void multi_reset() self.solid = SOLID_BBOX; } self.think = func_null; + self.nextthink = 0; self.team = self.team_saved; } @@ -360,6 +361,7 @@ void delay_use() void delay_reset() { self.think = func_null; + self.nextthink = 0: } void spawnfunc_trigger_delay() diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index d7a3b29ce..7c21c4e2e 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -414,7 +414,7 @@ void spawnfunc_func_rotating() // wait for targets to spawn self.nextthink = self.ltime + 999999999; - self.think = func_null; + self.think = SUB_NullThink; // for PushMove // TODO make a reset function for this one } @@ -495,7 +495,7 @@ void spawnfunc_func_bobbing() controller.nextthink = time + 1; controller.think = func_bobbing_controller_think; self.nextthink = self.ltime + 999999999; - self.think = func_null; + self.think = SUB_NullThink; // for PushMove // Savage: Reduce bandwith, critical on e.g. nexdm02 self.effects |= EF_LOWPRECISION; @@ -572,7 +572,7 @@ void spawnfunc_func_pendulum() controller.nextthink = time + 1; controller.think = func_pendulum_controller_think; self.nextthink = self.ltime + 999999999; - self.think = func_null; + self.think = SUB_NullThink; // for PushMove //self.effects |= EF_LOWPRECISION; @@ -1389,6 +1389,7 @@ void door_reset() self.velocity = '0 0 0'; self.state = STATE_BOTTOM; self.think = func_null; + self.nextthink = 0; } // spawnflags require key (for now only func_door) @@ -1501,6 +1502,7 @@ void door_rotating_reset() self.avelocity = '0 0 0'; self.state = STATE_BOTTOM; self.think = func_null; + self.nextthink = 0; } void door_rotating_init_startopen() @@ -1770,6 +1772,7 @@ void secret_reset() } setorigin(self, self.oldorigin); self.think = func_null; + self.nextthink = 0; } /*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot @@ -1909,7 +1912,7 @@ void spawnfunc_func_fourier() controller.nextthink = time + 1; controller.think = func_fourier_controller_think; self.nextthink = self.ltime + 999999999; - self.think = func_null; + self.think = SUB_NullThink; // for PushMove // Savage: Reduce bandwith, critical on e.g. nexdm02 self.effects |= EF_LOWPRECISION; @@ -2065,7 +2068,7 @@ void spawnfunc_func_vectormamamam() // wait for targets to spawn self.nextthink = self.ltime + 999999999; - self.think = func_null; + self.think = SUB_NullThink; // for PushMove // Savage: Reduce bandwith, critical on e.g. nexdm02 self.effects |= EF_LOWPRECISION; -- 2.39.2