From bc1dd9e25943d6f49c3d4546f4f54af84ee1a136 Mon Sep 17 00:00:00 2001 From: ZivDero Date: Wed, 11 Sep 2024 16:24:00 +0300 Subject: [PATCH] Remove unnecessary state --- src/extensions/tiberium/tiberiumext.cpp | 20 +++++++++----------- src/extensions/tiberium/tiberiumext.h | 10 ---------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/extensions/tiberium/tiberiumext.cpp b/src/extensions/tiberium/tiberiumext.cpp index af47d0d95..12f072d80 100644 --- a/src/extensions/tiberium/tiberiumext.cpp +++ b/src/extensions/tiberium/tiberiumext.cpp @@ -127,8 +127,6 @@ HRESULT TiberiumClassExtension::Load(IStream *pStm) } new (this) TiberiumClassExtension(NoInitClass()); - - VINIFERA_SWIZZLE_REQUEST_POINTER_REMAP(Overlay, "Overlay"); return hr; } @@ -196,11 +194,6 @@ bool TiberiumClassExtension::Read_INI(CCINIClass &ini) { //EXT_DEBUG_TRACE("TiberiumClassExtension::Read_INI - Name: %s (0x%08X)\n", Name(), (uintptr_t)(This())); - // Default values set from the TiberiumType - Overlay = This()->Image; - UseSlopes = This()->NumSlopeFacings > 0; - DamageToInfantry = This()->Power / 10; - if (!AbstractTypeClassExtension::Read_INI(ini)) { return false; } @@ -214,13 +207,18 @@ bool TiberiumClassExtension::Read_INI(CCINIClass &ini) PipIndex = ini.Get_Int(ini_name, "PipIndex", PipIndex); PipDrawOrder = ini.Get_Int(ini_name, "PipDrawOrder", PipDrawOrder); - Overlay = (OverlayTypeClass*)ini.Get_Overlay(ini_name, "Overlay", Overlay); - UseSlopes = ini.Get_Bool(ini_name, "UseSlopes", UseSlopes); + // Default values set from the TiberiumType + OverlayTypeClass* overlay = This()->Image; + bool useSlopes = This()->NumSlopeFacings > 0; + DamageToInfantry = This()->Power / 10; + + overlay = (OverlayTypeClass*)ini.Get_Overlay(ini_name, "Overlay", overlay); + useSlopes = ini.Get_Bool(ini_name, "UseSlopes", useSlopes); - This()->Image = Overlay; + This()->Image = overlay; This()->NumFrames = 12; This()->NumImages = 12; - This()->NumSlopeFacings = UseSlopes ? 8 : 0; + This()->NumSlopeFacings = useSlopes ? 8 : 0; DamageToInfantry = ini.Get_Int(ini_name, "DamageToInfantry", DamageToInfantry); diff --git a/src/extensions/tiberium/tiberiumext.h b/src/extensions/tiberium/tiberiumext.h index c927f3574..602d84b9a 100644 --- a/src/extensions/tiberium/tiberiumext.h +++ b/src/extensions/tiberium/tiberiumext.h @@ -72,16 +72,6 @@ TiberiumClassExtension final : public AbstractTypeClassExtension */ int PipDrawOrder; - /** - * Custom OverlayType that is the start of this Tiberium's overlays. - */ - OverlayTypeClass* Overlay; - - /** - * Should this Tiberium type use slopes? - */ - bool UseSlopes; - /** * The damage this Tiberium does to infantry. */