From be812d43088c012bde9b3ba425aeea085705c41f Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Tue, 17 Sep 2019 12:30:40 -0400 Subject: [PATCH] fix assign-function-types issues --- gmqcc.ini | 7 +++---- progs.src | 16 ++++++++-------- source/defs.qc | 3 ++- source/dog.qc | 2 +- source/doors.qc | 7 ++++--- source/oldone.qc | 4 ++-- source/player.qc | 2 +- source/shalrath.qc | 2 +- source/subs.qc | 2 +- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/gmqcc.ini b/gmqcc.ini index fa08bce..b138264 100644 --- a/gmqcc.ini +++ b/gmqcc.ini @@ -1,7 +1,7 @@ [flags] ADJUST_VECTOR_FIELDS = true ARITHMETIC_EXCEPTIONS = true - ASSIGN_FUNCTION_TYPES = true + ASSIGN_FUNCTION_TYPES = false BAIL_ON_WERROR = true CORRECT_LOGIC = true CORRECT_TERNARY = true @@ -35,9 +35,8 @@ VARIADIC_ARGS = true [warnings] - ALL = true - ASSIGN_FUNCTION_TYPES = false - USED_UNINITIALIZED = false + ALL = true + USED_UNINITIALIZED = false [optimizations] PEEPHOLE = true diff --git a/progs.src b/progs.src index f01dbf9..01332da 100644 --- a/progs.src +++ b/progs.src @@ -19,19 +19,19 @@ source/triggers.qc source/weapons.qc source/world.qc -source/ogre.qc +source/boss.qc source/demon.qc -source/shambler.qc +source/dog.qc source/knight.qc +source/ogre.qc +source/shambler.qc source/soldier.qc source/wizard.qc -source/dog.qc source/zombie.qc -source/boss.qc -source/tarbaby.qc -source/hknight.qc -source/fish.qc -source/shalrath.qc source/enforcer.qc +source/fish.qc +source/hknight.qc source/oldone.qc +source/shalrath.qc +source/tarbaby.qc diff --git a/source/defs.qc b/source/defs.qc index abffa8e..b77d72c 100644 --- a/source/defs.qc +++ b/source/defs.qc @@ -637,6 +637,7 @@ void() SUB_CalcMoveDone; void() SUB_CalcAngleMoveDone; void(void() thinkst) SUB_CheckRefire; void() SUB_Null; +void(entity attacker, float damage) SUB_PainNull; void() SUB_UseTargets; void() SUB_Remove; @@ -762,7 +763,7 @@ void() player_died1; void() player_diee1; void() player_light1; void() player_nail1; -void() player_pain; +void(entity attacker, float damage) player_pain; void() player_rocket1; void() player_run; void() player_run; diff --git a/source/dog.qc b/source/dog.qc index ce613a3..448bc14 100644 --- a/source/dog.qc +++ b/source/dog.qc @@ -188,7 +188,7 @@ void() dog_painb14 = [ $painb14, dog_painb15 ] {}; void() dog_painb15 = [ $painb15, dog_painb16 ] {}; void() dog_painb16 = [ $painb16, dog_run1 ] {}; -void() dog_pain = { +void(entity attacker, float damage) dog_pain = { sound(self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM); if(random() > 0.5) { diff --git a/source/doors.qc b/source/doors.qc index bbab6ae..1c0ba8b 100644 --- a/source/doors.qc +++ b/source/doors.qc @@ -534,7 +534,7 @@ void() fd_secret_use = { SUB_UseTargets(); // fire all targets / killtargets if(!(self.spawnflags & SECRET_NO_SHOOT)) { - self.th_pain = SUB_Null; + self.th_pain = SUB_PainNull; self.takedamage = DAMAGE_NO; } self.velocity = '0 0 0'; @@ -569,6 +569,7 @@ void() fd_secret_use = { SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); }; +void(entity attacker, float damage) fd_secret_pain = {fd_secret_use();}; // Wait after first movement... void() fd_secret_move1 = { @@ -614,7 +615,7 @@ void() fd_secret_done = { if(!self.targetname || self.spawnflags & SECRET_YES_SHOOT) { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; } sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); }; @@ -714,7 +715,7 @@ void() func_door_secret = { if(!self.targetname || self.spawnflags & SECRET_YES_SHOOT) { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; self.th_die = fd_secret_use; } self.oldorigin = self.origin; diff --git a/source/oldone.qc b/source/oldone.qc index f0ce6a1..f8f6c8d 100644 --- a/source/oldone.qc +++ b/source/oldone.qc @@ -220,7 +220,7 @@ void() finale_4 = { //============================================================================ -void() nopain = { +void(entity attacker, float damage) old_pain = { self.health = 40000; }; @@ -251,7 +251,7 @@ void() monster_oldone = { self.think = old_idle1; self.nextthink = time + 0.1; self.takedamage = DAMAGE_YES; - self.th_pain = nopain; + self.th_pain = old_pain; self.th_die = finale_1; shub = self; diff --git a/source/player.qc b/source/player.qc index 1dd2811..d74657c 100644 --- a/source/player.qc +++ b/source/player.qc @@ -317,7 +317,7 @@ void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; void() player_axpain6 = [ $axpain6, player_run ] {}; -void() player_pain = { +void(entity attacker, float damage) player_pain = { if(self.weaponframe) { return; } diff --git a/source/shalrath.qc b/source/shalrath.qc index 1d6051f..e94e634 100644 --- a/source/shalrath.qc +++ b/source/shalrath.qc @@ -83,7 +83,7 @@ void() shal_death5 = [ $death5, shal_death6 ] {}; void() shal_death6 = [ $death6, shal_death7 ] {}; void() shal_death7 = [ $death7, shal_death7 ] {}; -void() shalrath_pain = { +void(entity attacker, float damage) shalrath_pain = { if(self.pain_finished > time) { return; } diff --git a/source/subs.qc b/source/subs.qc index 0b5634a..27bd729 100644 --- a/source/subs.qc +++ b/source/subs.qc @@ -1,7 +1,7 @@ // subs.qc: subroutines for think frames void() SUB_Null = {}; - +void(entity attacker, float damage) SUB_PainNull = {}; void() SUB_Remove = {remove(self);}; /*