]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
OO: `super` considered harmful; does not handle multiple ancestors
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 27 Oct 2015 05:54:54 +0000 (16:54 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 27 Oct 2015 05:54:54 +0000 (16:54 +1100)
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/lib/oo.qh
qcsrc/menu/xonotic/datasource.qc
qcsrc/menu/xonotic/dialog_settings_game.qc

index 318f4e8ae69e2e31f28d33434fb26dde9e1841c2..7ed255911b4d57f5ccea0d3c0f58838585446639 100644 (file)
@@ -41,7 +41,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this))
     }
     else
     {
-        super.tr_attack(this);
+        SUPER(PlasmaTurret).tr_attack(this);
     }
     if (self.tur_head.frame == 0)
         self.tur_head.frame = 1;
index 387ae44a594dc8f851b06d85834f119d092ca5a5..8069401e4bb35d075acac4a36f739a85690fb8a8 100644 (file)
@@ -41,7 +41,7 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this))
         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
         WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
     } else {
-        super.vtblbase.tr_attack(this);
+        SUPER(PlasmaTurret).tr_attack(this);
     }
     self.tur_head.frame += 1;
 }
index 8d60cda041cdc2cd8ec3c901d98678cb69b642a4..6a9a2e3b7d317bea9cb6424ed77c9f15602760f5 100644 (file)
@@ -146,7 +146,6 @@ STATIC_INIT(RegisterClasses)
        }
 
 #define SUPER(cname) (cname##_vtbl.vtblbase)
-#define super (this.vtblbase.vtblbase)
 
 #define spawn_static(this)
 #define spawn_1(this)
index 57ce0c80c312e73c7826110a6075dc8a6e9b4284..3b8be8d27b0a4d57bb441136688e2411b392223b 100644 (file)
@@ -57,13 +57,13 @@ CLASS(CvarStringSource, StringSource)
     {
         string s = this.CvarStringSource_cvar;
         this.StringSource_str = s ? cvar_string(s) : string_null;
-        return super.getEntry(this, i, returns);
+        return SUPER(CvarStringSource).getEntry(this, i, returns);
     }
     METHOD(CvarStringSource, reload, int(entity this, string filter))
     {
         string s = this.CvarStringSource_cvar;
         this.StringSource_str = s ? cvar_string(s) : string_null;
-        return super.reload(this, filter);
+        return SUPER(CvarStringSource).reload(this, filter);
     }
 ENDCLASS(CvarStringSource)
 #endif
index 3c1503b29774472af5b256b37930c7736c454d81..0a9907b808ab0441cd2074ff2d10fd77f18a5106 100644 (file)
@@ -94,7 +94,7 @@ CLASS(XonoticRegisteredSettingsList, XonoticListBox)
        }
        METHOD(XonoticRegisteredSettingsList, resizeNotify, void(entity this, vector relOrigin, vector relSize, vector absOrigin, vector absSize))
        {
-               super.resizeNotify(this, relOrigin, relSize, absOrigin, absSize);
+               SUPER(XonoticRegisteredSettingsList).resizeNotify(this, relOrigin, relSize, absOrigin, absSize);
 
                this.itemAbsSize = '0 0 0';
                this.realFontSize_y = this.fontSize / (this.itemAbsSize_y = (absSize.y * this.itemHeight));
@@ -103,7 +103,7 @@ CLASS(XonoticRegisteredSettingsList, XonoticListBox)
        }
        METHOD(XonoticRegisteredSettingsList, setSelected, void(entity this, int i))
        {
-               super.setSelected(this, i);
+               SUPER(XonoticRegisteredSettingsList).setSelected(this, i);
                this.onChange(this, this.onChangeEntity);
        }
     CONSTRUCTOR(XonoticRegisteredSettingsList, DataSource _source) {