From 468fc5aa7ebf5f772bcc5f632935d8c50546314a Mon Sep 17 00:00:00 2001 From: otta8634 Date: Thu, 9 Jan 2025 00:18:36 +0800 Subject: [PATCH] Remove mutators constructor This allows for classes to inherit Mutator without having to copy paste the CONSTRUCTOR, since CONSTRUCTOR inheritance doesn't work currently for some reason. This can be reverted easily in future when CONSTRUCTOR inheritance is fixed. --- qcsrc/common/mutators/base.qh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index def5e367ee..de637b0770 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -167,11 +167,6 @@ CLASS(Mutator, Object) METHOD(Mutator, display, void(entity this, void(string name, string icon) returns)) { returns(this.m_name, this.m_icon); } - CONSTRUCTOR(Mutator, string _name, mutatorfunc_t func) { - CONSTRUCT(Mutator); - this.mutatorname = _name; - this.mutatorfunc = func; - } ENDCLASS(Mutator) REGISTRY(Mutators, BITS(7)) @@ -277,8 +272,12 @@ void Mutator_Remove(Mutator mut) bool ret = MUTATORFUNC_##id##_hooks(mode); if (ret) return ret; \ } \ bool MUTATOR_##id##_check() { return dependence; } \ - REGISTER(Mutators, MUTATOR, id, m_id, NEW(cname, #id, MUTATORFUNC_##id)) \ - { this.mutatorcheck = MUTATOR_##id##_check; } \ + REGISTER(Mutators, MUTATOR, id, m_id, NEW(cname)) \ + { \ + this.mutatorname = #id; \ + this.mutatorfunc = MUTATORFUNC_##id; \ + this.mutatorcheck = MUTATOR_##id##_check; \ + } \ ACCUMULATE bool MUTATORFUNC_##id(int mode) #define REGISTER_MUTATOR(...) EVAL(OVERLOAD(REGISTER_MUTATOR, __VA_ARGS__)) -- 2.39.5