From 1943c6743ba933fdbb9715d1c2f05809b6f4974a Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 20 Jul 2021 16:45:15 +1000 Subject: [PATCH] Consolidate ifdefs in powerup headers --- .../mutator/powerups/powerup/invisibility.qh | 12 ++++-------- .../mutators/mutator/powerups/powerup/shield.qh | 9 +++------ .../mutators/mutator/powerups/powerup/speed.qh | 12 ++++-------- .../mutators/mutator/powerups/powerup/strength.qh | 9 +++------ 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh index a0d1d7655..24bda9cd4 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh @@ -32,10 +32,12 @@ REGISTER_ITEM(Invisibility, Powerup) { this.spawnflags = ITEM_FLAG_NORMAL; else this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; + + this.m_iteminit = powerup_invisibility_init; #endif #ifdef GAMEQC -// this.m_model = MDL_Invisibility_ITEM; // TODO: new model required - this.m_model = MDL_BUFF; + this.m_itemid = IT_INVISIBILITY; + this.m_model = MDL_BUFF; // TODO: MDL_Invisibility_ITEM when new model available this.m_skin = 12; this.m_sound = SND_Invisibility; this.m_glow = true; @@ -47,12 +49,6 @@ REGISTER_ITEM(Invisibility, Powerup) { this.m_color = '0.5 0.5 1'; this.m_waypoint = _("Invisibility"); this.m_waypointblink = 2; -#ifdef GAMEQC - this.m_itemid = IT_INVISIBILITY; -#endif -#ifdef SVQC - this.m_iteminit = powerup_invisibility_init; -#endif } SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh index 4267889ac..3e482d053 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh @@ -31,8 +31,11 @@ REGISTER_ITEM(Shield, Powerup) { this.spawnflags = ITEM_FLAG_NORMAL; else this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; + + this.m_iteminit = powerup_shield_init; #endif #ifdef GAMEQC + this.m_itemid = IT_INVINCIBLE; this.m_model = MDL_Shield_ITEM; this.m_sound = SND_Shield; this.m_glow = true; @@ -44,12 +47,6 @@ REGISTER_ITEM(Shield, Powerup) { this.m_color = '1 0 1'; this.m_waypoint = _("Shield"); this.m_waypointblink = 2; -#ifdef GAMEQC - this.m_itemid = IT_INVINCIBLE; -#endif -#ifdef SVQC - this.m_iteminit = powerup_shield_init; -#endif } SPAWNFUNC_ITEM(item_shield, ITEM_Shield) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh index 6b127e39f..4bdfe3210 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh @@ -33,10 +33,12 @@ REGISTER_ITEM(Speed, Powerup) { this.spawnflags = ITEM_FLAG_NORMAL; else this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; + + this.m_iteminit = powerup_speed_init; #endif #ifdef GAMEQC -// this.m_model = MDL_Speed_ITEM; // TODO: new model required - this.m_model = MDL_BUFF; + this.m_itemid = IT_SPEED; + this.m_model = MDL_BUFF; // TODO: MDL_Speed_ITEM when new model available this.m_skin = 9; this.m_sound = SND_Speed; this.m_glow = true; @@ -48,12 +50,6 @@ REGISTER_ITEM(Speed, Powerup) { this.m_color = '0.1 1 0.84'; this.m_waypoint = _("Speed"); this.m_waypointblink = 2; -#ifdef GAMEQC - this.m_itemid = IT_SPEED; -#endif -#ifdef SVQC - this.m_iteminit = powerup_speed_init; -#endif } SPAWNFUNC_ITEM(item_speed, ITEM_Speed) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh index 81d939e67..8d25bfb90 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh @@ -33,8 +33,11 @@ REGISTER_ITEM(Strength, Powerup) { this.spawnflags = ITEM_FLAG_NORMAL; else this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; + + this.m_iteminit = powerup_strength_init; #endif #ifdef GAMEQC + this.m_itemid = IT_STRENGTH; this.m_model = MDL_Strength_ITEM; this.m_sound = SND_Strength; this.m_glow = true; @@ -46,12 +49,6 @@ REGISTER_ITEM(Strength, Powerup) { this.m_color = '0 0 1'; this.m_waypoint = _("Strength"); this.m_waypointblink = 2; -#ifdef GAMEQC - this.m_itemid = IT_STRENGTH; -#endif -#ifdef SVQC - this.m_iteminit = powerup_strength_init; -#endif } SPAWNFUNC_ITEM(item_strength, ITEM_Strength) -- 2.39.2