From: terencehill Date: Mon, 29 Jul 2019 13:10:23 +0000 (+0200) Subject: Consistently call nexball REGISTER_MUTATOR with false as second parameter, like other... X-Git-Tag: xonotic-v0.8.5~1435 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f63733d5838553838e5b58ae413e016cc2b0467f;p=xonotic%2Fxonotic-data.pk3dir.git Consistently call nexball REGISTER_MUTATOR with false as second parameter, like other game modes do. Add _MUTATOR_IS_ENABLED macro --- diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index c841079fb..ec46ac836 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -947,7 +947,7 @@ MUTATOR_HOOKFUNCTION(nb, SendWaypoint) M_ARGV(2, int) &= ~0x80; } -REGISTER_MUTATOR(nb, g_nexball) +REGISTER_MUTATOR(nb, false) { MUTATOR_STATIC(); MUTATOR_ONADD diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index c1d658576..cc4cc0129 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -171,7 +171,8 @@ void Mutator_Remove(Mutator mut); bool mutator_log = false; .bool m_added; -#define MUTATOR_IS_ENABLED(this) MUTATOR_##this.mutatorcheck() +#define _MUTATOR_IS_ENABLED(this) this.mutatorcheck() +#define MUTATOR_IS_ENABLED(this) _MUTATOR_IS_ENABLED(MUTATOR_##this) #ifdef GAMEQC /** server mutators activate corresponding client mutators for all clients */ @@ -276,7 +277,7 @@ STATIC_INIT(Mutators) { } STATIC_INIT_LATE(Mutators) { - FOREACH(Mutators, it.mutatorcheck(), Mutator_Add(it)); + FOREACH(Mutators, _MUTATOR_IS_ENABLED(it), Mutator_Add(it)); } #define MUTATOR_ONADD if (mode == MUTATOR_ADDING)