diff --git a/src/Ext/SWType/Body.cpp b/src/Ext/SWType/Body.cpp index a371547bc0..a8eeedbd50 100644 --- a/src/Ext/SWType/Body.cpp +++ b/src/Ext/SWType/Body.cpp @@ -143,6 +143,11 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->LimboDelivery_Types.Read(exINI, pSection, "LimboDelivery.Types"); this->LimboDelivery_IDs.Read(exINI, pSection, "LimboDelivery.IDs"); this->LimboDelivery_RollChances.Read(exINI, pSection, "LimboDelivery.RollChances"); + if (exINI.ReadString(pSection, "LimboKill.Affected") > 0) + { + Debug::Log("[Developer warning][%s] LimboKill.Affected is deprecated and has been replaced by LimboKill.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->LimboKill_AffectsHouse.Read(exINI, pSection, "LimboKill.Affected"); // Temporary solution for the INI tags renaming issue, see #2093 this->LimboKill_AffectsHouse.Read(exINI, pSection, "LimboKill.AffectsHouse"); this->LimboKill_IDs.Read(exINI, pSection, "LimboKill.IDs"); this->LimboKill_Counts.Read(exINI, pSection, "LimboKill.Counts"); diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 8cc82868c4..87e2d8119a 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -861,7 +861,17 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus"); this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier"); + if (exINI.ReadString(pSection, "AutoFire") > 0) + { + Debug::Log("[Developer warning][%s] AutoFire is deprecated and has been replaced by AutoTargetOwnPosition! If both are set, the latter will be used.\n", pSection); + } + this->AutoTargetOwnPosition.Read(exINI, pSection, "AutoFire"); // Temporary solution for the INI tags renaming issue, see #2093 this->AutoTargetOwnPosition.Read(exINI, pSection, "AutoTargetOwnPosition"); + if (exINI.ReadString(pSection, "AutoFire.TargetSelf") > 0) + { + Debug::Log("[Developer warning][%s] AutoFire.TargetSelf is deprecated and has been replaced by AutoTargetOwnPosition.Self! If both are set, the latter will be used.\n", pSection); + } + this->AutoTargetOwnPosition_Self.Read(exINI, pSection, "AutoFire.TargetSelf"); // Temporary solution for the INI tags renaming issue, see #2093 this->AutoTargetOwnPosition_Self.Read(exINI, pSection, "AutoTargetOwnPosition.Self"); this->NoSecondaryWeaponFallback.Read(exINI, pSection, "NoSecondaryWeaponFallback"); @@ -1007,6 +1017,11 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Tint_VisibleToHouses.Read(exINI, pSection, "Tint.VisibleToHouses"); this->RevengeWeapon.Read(exINI, pSection, "RevengeWeapon"); + if (exINI.ReadString(pSection, "RevengeWeapon.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] RevengeWeapon.AffectsHouses is deprecated and has been replaced by RevengeWeapon.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->RevengeWeapon_AffectsHouse.Read(exINI, pSection, "RevengeWeapon.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->RevengeWeapon_AffectsHouse.Read(exINI, pSection, "RevengeWeapon.AffectsHouse"); this->RecountBurst.Read(exINI, pSection, "RecountBurst"); diff --git a/src/Ext/WarheadType/Body.cpp b/src/Ext/WarheadType/Body.cpp index 589b162dfa..9c741ef1e0 100644 --- a/src/Ext/WarheadType/Body.cpp +++ b/src/Ext/WarheadType/Body.cpp @@ -119,6 +119,9 @@ DamageAreaResult WarheadTypeExt::ExtData::DamageAreaWithTarget(const CoordStruct void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) { + if (lastLoadedINI == reinterpret_cast(pINI)) + return; + lastLoadedINI = reinterpret_cast(pINI); auto pThis = this->OwnerObject(); const char* pSection = pThis->ID; INI_EX exINI(pINI); @@ -162,14 +165,34 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Crit_ExtraDamage_ApplyFirepowerMult.Read(exINI, pSection, "Crit.ExtraDamage.ApplyFirepowerMult"); this->Crit_Warhead.Read(exINI, pSection, "Crit.Warhead"); this->Crit_Warhead_FullDetonation.Read(exINI, pSection, "Crit.Warhead.FullDetonation"); + if (exINI.ReadString(pSection, "Crit.Affects") > 0) + { + Debug::Log("[Developer warning][%s] Crit.Affects is deprecated and has been replaced by Crit.AffectsTarget! If both are set, the latter will be used.\n", pSection); + } + this->Crit_AffectsTarget.Read(exINI, pSection, "Crit.Affects"); // Temporary solution for the INI tags renaming issue, see #2093 this->Crit_AffectsTarget.Read(exINI, pSection, "Crit.AffectsTarget"); + if (exINI.ReadString(pSection, "Crit.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] Crit.AffectsHouses is deprecated and has been replaced by Crit.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->Crit_AffectsHouse.Read(exINI, pSection, "Crit.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->Crit_AffectsHouse.Read(exINI, pSection, "Crit.AffectsHouse"); this->Crit_AnimList.Read(exINI, pSection, "Crit.AnimList"); this->Crit_AnimList_PickRandom.Read(exINI, pSection, "Crit.AnimList.PickRandom"); this->Crit_AnimList_CreateAll.Read(exINI, pSection, "Crit.AnimList.CreateAll"); this->Crit_ActiveChanceAnims.Read(exINI, pSection, "Crit.ActiveChanceAnims"); this->Crit_AnimOnAffectedTargets.Read(exINI, pSection, "Crit.AnimOnAffectedTargets"); + if (exINI.ReadString(pSection, "Crit.AffectBelowPercent") > 0) + { + Debug::Log("[Developer warning][%s] Crit.AffectBelowPercent is deprecated and has been replaced by Crit.AffectsBelowPercent! If both are set, the latter will be used.\n", pSection); + } + this->Crit_AffectsBelowPercent.Read(exINI, pSection, "Crit.AffectBelowPercent"); // Temporary solution for the INI tags renaming issue, see #2093 this->Crit_AffectsBelowPercent.Read(exINI, pSection, "Crit.AffectsBelowPercent"); + if (exINI.ReadString(pSection, "Crit.AffectAbovePercent") > 0) + { + Debug::Log("[Developer warning][%s] Crit.AffectAbovePercent is deprecated and has been replaced by Crit.AffectsAbovePercent! If both are set, the latter will be used.\n", pSection); + } + this->Crit_AffectsAbovePercent.Read(exINI, pSection, "Crit.AffectAbovePercent"); // Temporary solution for the INI tags renaming issue, see #2093 this->Crit_AffectsAbovePercent.Read(exINI, pSection, "Crit.AffectsAbovePercent"); this->Crit_SuppressWhenIntercepted.Read(exINI, pSection, "Crit.SuppressWhenIntercepted"); @@ -249,7 +272,17 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->DetonateOnAllMapObjects.Read(exINI, pSection, "DetonateOnAllMapObjects"); this->DetonateOnAllMapObjects_Full.Read(exINI, pSection, "DetonateOnAllMapObjects.Full"); this->DetonateOnAllMapObjects_RequireVerses.Read(exINI, pSection, "DetonateOnAllMapObjects.RequireVerses"); + if (exINI.ReadString(pSection, "DetonateOnAllMapObjects.AffectTargets") > 0) + { + Debug::Log("[Developer warning][%s] DetonateOnAllMapObjects.AffectTargets is deprecated and has been replaced by DetonateOnAllMapObjects.AffectsTarget! If both are set, the latter will be used.\n", pSection); + } + this->DetonateOnAllMapObjects_AffectsTarget.Read(exINI, pSection, "DetonateOnAllMapObjects.AffectTargets"); // Temporary solution for the INI tags renaming issue, see #2093 this->DetonateOnAllMapObjects_AffectsTarget.Read(exINI, pSection, "DetonateOnAllMapObjects.AffectsTarget"); + if (exINI.ReadString(pSection, "DetonateOnAllMapObjects.AffectHouses") > 0) + { + Debug::Log("[Developer warning][%s] DetonateOnAllMapObjects.AffectHouses is deprecated and has been replaced by DetonateOnAllMapObjects.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->DetonateOnAllMapObjects_AffectsHouse.Read(exINI, pSection, "DetonateOnAllMapObjects.AffectHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->DetonateOnAllMapObjects_AffectsHouse.Read(exINI, pSection, "DetonateOnAllMapObjects.AffectsHouse"); this->DetonateOnAllMapObjects_AffectTypes.Read(exINI, pSection, "DetonateOnAllMapObjects.AffectTypes"); this->DetonateOnAllMapObjects_IgnoreTypes.Read(exINI, pSection, "DetonateOnAllMapObjects.IgnoreTypes"); @@ -294,9 +327,29 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->KillWeapon.Read(exINI, pSection, "KillWeapon"); this->KillWeapon_OnFirer.Read(exINI, pSection, "KillWeapon.OnFirer"); + if (exINI.ReadString(pSection, "KillWeapon.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] KillWeapon.AffectsHouses is deprecated and has been replaced by KillWeapon.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->KillWeapon_AffectsHouse.Read(exINI, pSection, "KillWeapon.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->KillWeapon_AffectsHouse.Read(exINI, pSection, "KillWeapon.AffectsHouse"); + if (exINI.ReadString(pSection, "KillWeapon.OnFirer.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] KillWeapon.OnFirer.AffectsHouses is deprecated and has been replaced by KillWeapon.OnFirer.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->KillWeapon_OnFirer_AffectsHouse.Read(exINI, pSection, "KillWeapon.OnFirer.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->KillWeapon_OnFirer_AffectsHouse.Read(exINI, pSection, "KillWeapon.OnFirer.AffectsHouse"); + if (exINI.ReadString(pSection, "KillWeapon.Affects") > 0) + { + Debug::Log("[Developer warning][%s] KillWeapon.Affects is deprecated and has been replaced by KillWeapon.AffectsTarget! If both are set, the latter will be used.\n", pSection); + } + this->KillWeapon_AffectsTarget.Read(exINI, pSection, "KillWeapon.Affects"); // Temporary solution for the INI tags renaming issue, see #2093 this->KillWeapon_AffectsTarget.Read(exINI, pSection, "KillWeapon.AffectsTarget"); + if (exINI.ReadString(pSection, "KillWeapon.OnFirer.Affects") > 0) + { + Debug::Log("[Developer warning][%s] KillWeapon.OnFirer.Affects is deprecated and has been replaced by KillWeapon.OnFirer.AffectsTarget! If both are set, the latter will be used.\n", pSection); + } + this->KillWeapon_OnFirer_AffectsTarget.Read(exINI, pSection, "KillWeapon.OnFirer.Affects"); // Temporary solution for the INI tags renaming issue, see #2093 this->KillWeapon_OnFirer_AffectsTarget.Read(exINI, pSection, "KillWeapon.OnFirer.AffectsTarget"); this->ElectricAssaultLevel.Read(exINI, pSection, "ElectricAssaultLevel"); diff --git a/src/Ext/WarheadType/Body.h b/src/Ext/WarheadType/Body.h index 41acdffa76..bad037f0ea 100644 --- a/src/Ext/WarheadType/Body.h +++ b/src/Ext/WarheadType/Body.h @@ -259,6 +259,7 @@ class WarheadTypeExt private: Valueable Shield_Respawn_Rate_InMinutes; Valueable Shield_SelfHealing_Rate_InMinutes; + uintptr_t lastLoadedINI; public: ExtData(WarheadTypeClass* OwnerObject) : Extension(OwnerObject) @@ -496,6 +497,8 @@ class WarheadTypeExt , ApplyPerTargetEffectsOnDetonate {} , Taunt { false } + + , lastLoadedINI { 0 } { } void ApplyConvert(HouseClass* pHouse, TechnoClass* pTarget); diff --git a/src/New/Type/Affiliated/TypeConvertGroup.cpp b/src/New/Type/Affiliated/TypeConvertGroup.cpp index 94c611179c..4b23557cf0 100644 --- a/src/New/Type/Affiliated/TypeConvertGroup.cpp +++ b/src/New/Type/Affiliated/TypeConvertGroup.cpp @@ -56,6 +56,13 @@ void TypeConvertGroup::Parse(std::vector& list, INI_EX& exINI, convertFrom.Read(exINI, pSection, tempBuffer); _snprintf_s(tempBuffer, sizeof(tempBuffer), "Convert%d.To", i); convertTo.Read(exINI, pSection, tempBuffer); + _snprintf_s(tempBuffer, sizeof(tempBuffer), "Convert%d.AffectedHouses", i); // Temporary solution for the INI tags renaming issue, see #2093 + convertAffectsHouse.Read(exINI, pSection, tempBuffer); + if (convertAffectsHouse.isset()) + { + Debug::Log("[Developer warning][%s] %s is deprecated and has been replaced by Convert%d.AffectsHouse! If both are set, the latter will be used.\n", + pSection, tempBuffer, i); + } _snprintf_s(tempBuffer, sizeof(tempBuffer), "Convert%d.AffectsHouse", i); convertAffectsHouse.Read(exINI, pSection, tempBuffer); @@ -72,6 +79,11 @@ void TypeConvertGroup::Parse(std::vector& list, INI_EX& exINI, Nullable convertAffectsHouse; convertFrom.Read(exINI, pSection, "Convert.From"); convertTo.Read(exINI, pSection, "Convert.To"); + convertAffectsHouse.Read(exINI, pSection, "Convert.AffectedHouses"); // Temporary solution for the INI tags renaming issue, see #2093 + if (convertAffectsHouse.isset()) + { + Debug::Log("[Developer warning][%s] Convert.AffectedHouses is deprecated and has been replaced by Convert.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } convertAffectsHouse.Read(exINI, pSection, "Convert.AffectsHouse"); if (convertTo.isset()) { diff --git a/src/New/Type/AttachEffectTypeClass.cpp b/src/New/Type/AttachEffectTypeClass.cpp index 02bc5abb9e..5216d3744a 100644 --- a/src/New/Type/AttachEffectTypeClass.cpp +++ b/src/New/Type/AttachEffectTypeClass.cpp @@ -105,6 +105,11 @@ void AttachEffectTypeClass::LoadFromINI(CCINIClass* pINI) this->PenetratesForceShield.Read(exINI, pSection, "PenetratesForceShield"); this->AffectTypes.Read(exINI, pSection, "AffectTypes"); this->IgnoreTypes.Read(exINI, pSection, "IgnoreTypes"); + if (exINI.ReadString(pSection, "AffectTargets") > 0) + { + Debug::Log("[Developer warning][%s] AffectTargets is deprecated and has been replaced by AffectsTarget! If both are set, the latter will be used.\n", pSection); + } + this->AffectsTarget.Read(exINI, pSection, "AffectTargets"); // Temporary solution for the INI tags renaming issue, see #2093 this->AffectsTarget.Read(exINI, pSection, "AffectsTarget"); this->Animation.Read(exINI, pSection, "Animation"); @@ -147,6 +152,11 @@ void AttachEffectTypeClass::LoadFromINI(CCINIClass* pINI) this->Crit_DisallowWarheads.Read(exINI, pSection, "Crit.DisallowWarheads"); this->RevengeWeapon.Read(exINI, pSection, "RevengeWeapon"); + if (exINI.ReadString(pSection, "RevengeWeapon.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] RevengeWeapon.AffectsHouses is deprecated and has been replaced by RevengeWeapon.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->RevengeWeapon_AffectsHouse.Read(exINI, pSection, "RevengeWeapon.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->RevengeWeapon_AffectsHouse.Read(exINI, pSection, "RevengeWeapon.AffectsHouse"); this->RevengeWeapon_UseInvokerAsOwner.Read(exINI, pSection, "RevengeWeapon.UseInvokerAsOwner"); @@ -154,6 +164,11 @@ void AttachEffectTypeClass::LoadFromINI(CCINIClass* pINI) this->ReflectDamage_Warhead.Read(exINI, pSection, "ReflectDamage.Warhead"); this->ReflectDamage_Warhead_Detonate.Read(exINI, pSection, "ReflectDamage.Warhead.Detonate"); this->ReflectDamage_Multiplier.Read(exINI, pSection, "ReflectDamage.Multiplier"); + if (exINI.ReadString(pSection, "ReflectDamage.AffectsHouses") > 0) + { + Debug::Log("[Developer warning][%s] ReflectDamage.AffectsHouses is deprecated and has been replaced by ReflectDamage.AffectsHouse! If both are set, the latter will be used.\n", pSection); + } + this->ReflectDamage_AffectsHouse.Read(exINI, pSection, "ReflectDamage.AffectsHouses"); // Temporary solution for the INI tags renaming issue, see #2093 this->ReflectDamage_AffectsHouse.Read(exINI, pSection, "ReflectDamage.AffectsHouse"); this->ReflectDamage_Chance.Read(exINI, pSection, "ReflectDamage.Chance"); this->ReflectDamage_Override.Read(exINI, pSection, "ReflectDamage.Override");