From f8f28afcecb87096346806c43816f8c52f6c1b64 Mon Sep 17 00:00:00 2001 From: Fly-Star <100747645+a851903106@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:01:19 +0800 Subject: [PATCH 1/7] update --- CREDITS.md | 1 + docs/Fixed-or-Improved-Logics.md | 7 +++- docs/Whats-New.md | 1 + src/Ext/Rules/Body.cpp | 9 +++++ src/Ext/Rules/Body.h | 10 +++++ src/Ext/TechnoType/Body.cpp | 2 + src/Ext/TechnoType/Body.h | 4 +- src/Misc/Hooks.Ares.cpp | 63 ++++++++++++++++++++++++++++++++ 8 files changed, 95 insertions(+), 2 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 919ed36608..10d3925ee2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -442,6 +442,7 @@ This page lists all the individual contributions to the project by their author. - Fix an issue where `OmniFire` was ineffective on buildings with `Turret=yes` - Fix an issue where setting a production building as `Primary` could cause it to enter an unload state - SkipMapSelect Enhancement + - Ares' `KeepAlive` adds global tags - **NetsuNegi**: - Forbidding parallel AI queues by type - Jumpjet crash speed fix when crashing onto building diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 4819a94776..d024c7a05e 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -384,6 +384,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Removed the restriction that prohibits InfantryTypes from using the InitialPayload logic. - `ProjectileRange` now has weapon range modifiers applied to it if greater than 0 and unless `ProjectileRange.ApplyModifiers` is set to false on the WeaponType. - Allowed customizing the default value of `[Warhead] -> PreventScatter` via `[CombatDamage] -> Warhead.PreventScatter`. +- Ares' `KeepAlive` adds global tags. ## Newly added global settings @@ -538,7 +539,11 @@ Unless otherwise specified, after removing the last dot and everything before it In `rulesmd.ini`: ```ini [General] -DefaultToGuardArea=false ; boolean +DefaultToGuardArea=false ; boolean +KeepAlive.SupportInfantrys=false ; boolean +KeepAlive.SupportVehicles=false ; boolean +KeepAlive.SupportAircrafts=false ; boolean +KeepAlive.SupportBuildings=false ; boolean [CombatDamage] Warhead.PreventScatter=false ; boolean diff --git a/docs/Whats-New.md b/docs/Whats-New.md index fd4878f814..cb4a863daa 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -844,6 +844,7 @@ HideShakeEffects=false ; boolean - Removed the restriction that prohibits InfantryTypes from using the InitialPayload logic (by Noble_Fish) - `ProjectileRange` now has weapon range modifiers applied to it if greater than 0 and unless `ProjectileRange.ApplyModifiers` is set to false on the WeaponType (by Starkku) - Allowed customizing the default value of `[Warhead] -> PreventScatter` via `[CombatDamage] -> Warhead.PreventScatter` (by Noble_Fish) +- Ares' `KeepAlive` adds global tags (by FlyStar) ``` ```{dropdown} Pre-release changes diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index e0d7f53ac5..a4401d52a0 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -610,6 +610,11 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->ReadyToNextMission_MovingCheck.Read(exINI, GameStrings::General, "ReadyToNextMission.MovingCheck"); this->Warhead_PreventScatter.Read(exINI, GameStrings::CombatDamage, "Warhead.PreventScatter"); + + this->KeepAlive_SupportInfantrys.Read(exINI, GameStrings::General, "KeepAlive.SupportInfantrys"); + this->KeepAlive_SupportVehicles.Read(exINI, GameStrings::General, "KeepAlive.SupportVehicles"); + this->KeepAlive_SupportAircrafts.Read(exINI, GameStrings::General, "KeepAlive.SupportAircrafts"); + this->KeepAlive_SupportBuildings.Read(exINI, GameStrings::General, "KeepAlive.SupportBuildings"); // Section AITargetTypes int itemsCount = pINI->GetKeyCount("AITargetTypes"); @@ -1087,6 +1092,10 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->NoAlphaImageOnBuildup) .Process(this->ReadyToNextMission_MovingCheck) .Process(this->Warhead_PreventScatter) + .Process(this->KeepAlive_SupportInfantrys) + .Process(this->KeepAlive_SupportVehicles) + .Process(this->KeepAlive_SupportAircrafts) + .Process(this->KeepAlive_SupportBuildings) ; } diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index 076d0d2ee6..7dfc7e6a16 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -534,6 +534,11 @@ class RulesExt Valueable NoAlphaImageOnBuildup; Valueable Warhead_PreventScatter; + + Valueable KeepAlive_SupportInfantrys; + Valueable KeepAlive_SupportVehicles; + Valueable KeepAlive_SupportAircrafts; + Valueable KeepAlive_SupportBuildings; ExtData(RulesClass* OwnerObject) : Extension(OwnerObject) , Storage_TiberiumIndex { -1 } @@ -1003,6 +1008,11 @@ class RulesExt , NoAlphaImageOnBuildup { false } , ReadyToNextMission_MovingCheck { false } , Warhead_PreventScatter { false } + + , KeepAlive_SupportInfantrys { false } + , KeepAlive_SupportVehicles { false } + , KeepAlive_SupportAircrafts { false } + , KeepAlive_SupportBuildings { true } { } virtual ~ExtData() = default; diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index b903cd3e35..9f76a2f170 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -1206,6 +1206,7 @@ void TechnoTypeExt::LoadFromINIFile(CCINIClass* const pINI) // Ares 3.0 this->Unsellable.Read(exINI, pSection, "Unsellable"); + this->KeepAlive.Read(exINI, pSection, "KeepAlive"); if (pThis->Gunner) { @@ -1804,6 +1805,7 @@ void TechnoTypeExt::Serialize(T& Stm) .Process(this->JumpjetClimbIgnoreBuilding) .Process(this->Unsellable) + .Process(this->KeepAlive) .Process(this->ExtraThreat_Enabled) .Process(this->ExtraThreat_IsThreat) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index e4ee3ab3e7..01f5586b55 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -438,7 +438,8 @@ class TechnoTypeExt : public ObjectTypeExt Valueable Convert_Health_BelowPercent; Nullable Convert_Health; - Nullable Unsellable; // Ares 3.0 + Nullable Unsellable; // Ares 3.0 + Nullable KeepAlive; // Ares 3.0 TechnoTypeExt(TechnoTypeClass* OwnerObject) : ObjectTypeExt(OwnerObject) , HealthBar_Hide { false } @@ -814,6 +815,7 @@ class TechnoTypeExt : public ObjectTypeExt , JumpjetClimbIgnoreBuilding {} , Unsellable {} + , KeepAlive {} , ExtraThreat_Enabled { false } , ExtraThreat_IsThreat {} diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index 1bed9df103..72d05079ee 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -177,6 +177,63 @@ static bool __fastcall ParadropPlaneUnlimbo(AircraftClass* pThis, void* _, const #pragma endregion +#pragma region AresKeepAlive + +struct AresHouseExt +{ + char _[0x18]; + int KeepAliveTechnos; + int KeepAliveBuildings; +}; + +static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, void*, TechnoClass* const pTechno, const AbstractType rtti, const bool add) +{ + bool keepAlive = false; + bool result = false; + auto const pType = pTechno->GetTechnoType(); + + if (!pType->Insignificant && !pType->DontScore) + { + switch (rtti) + { + case AbstractType::Infantry: + keepAlive = RulesExt::Global()->KeepAlive_SupportInfantrys; + break; + case AbstractType::Unit: + keepAlive = RulesExt::Global()->KeepAlive_SupportVehicles; + break; + case AbstractType::Aircraft: + keepAlive = RulesExt::Global()->KeepAlive_SupportAircrafts; + break; + case AbstractType::Building: + keepAlive = RulesExt::Global()->KeepAlive_SupportBuildings; + break; + default: + break; + } + + result = true; + } + + const Nullable& keepAliveValue = TechnoTypeExt::Fetch(pType)->KeepAlive; + + if (keepAliveValue.isset()) + keepAlive = keepAliveValue.Get(); + + if (keepAlive) + { + const int number = add ? 1 : -1; + pExt_Ares->KeepAliveTechnos += number; + + if (rtti == AbstractType::Building) + pExt_Ares->KeepAliveBuildings += number; + } + + return result; +} + +#pragma endregion + DEFINE_HOOK(0x440580, BuildingClass_Unlimbo_UnitDeliveryFix, 0x5) { if (UnitDeliveryTemp::Placing) @@ -307,6 +364,9 @@ void Apply_Ares3_0_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x4CE84, &BuildingExt::UpdateFactoryQueues); Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x4ADE0, GET_OFFSET(AresPreventScatter_Override)); + + // Ares' `KeepAlive` adds global tags. + Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x21F70, GET_OFFSET(AresHouseExt_UpdateKeepAlive)); } void Apply_Ares3_0p1_Patches() @@ -420,4 +480,7 @@ void Apply_Ares3_0p1_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x4DAF4, &BuildingExt::UpdateFactoryQueues); Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x4BA40, GET_OFFSET(AresPreventScatter_Override)); + + // Ares' `KeepAlive` adds global tags. + Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x229F0, GET_OFFSET(AresHouseExt_UpdateKeepAlive)); } From a3f3dd461dfd42be9e893a952c929e2a7dff9b90 Mon Sep 17 00:00:00 2001 From: Fly-Star <100747645+a851903106@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:01:19 +0800 Subject: [PATCH 2/7] update --- CREDITS.md | 1 + docs/Fixed-or-Improved-Logics.md | 7 +++- docs/Whats-New.md | 1 + src/Ext/Rules/Body.cpp | 9 +++++ src/Ext/Rules/Body.h | 10 +++++ src/Ext/TechnoType/Body.cpp | 2 + src/Ext/TechnoType/Body.h | 4 +- src/Misc/Hooks.Ares.cpp | 63 ++++++++++++++++++++++++++++++++ 8 files changed, 95 insertions(+), 2 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 919ed36608..10d3925ee2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -442,6 +442,7 @@ This page lists all the individual contributions to the project by their author. - Fix an issue where `OmniFire` was ineffective on buildings with `Turret=yes` - Fix an issue where setting a production building as `Primary` could cause it to enter an unload state - SkipMapSelect Enhancement + - Ares' `KeepAlive` adds global tags - **NetsuNegi**: - Forbidding parallel AI queues by type - Jumpjet crash speed fix when crashing onto building diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 4819a94776..66fbb8c42e 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -384,6 +384,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Removed the restriction that prohibits InfantryTypes from using the InitialPayload logic. - `ProjectileRange` now has weapon range modifiers applied to it if greater than 0 and unless `ProjectileRange.ApplyModifiers` is set to false on the WeaponType. - Allowed customizing the default value of `[Warhead] -> PreventScatter` via `[CombatDamage] -> Warhead.PreventScatter`. +- Ares' `KeepAlive` adds global tags. ## Newly added global settings @@ -538,7 +539,11 @@ Unless otherwise specified, after removing the last dot and everything before it In `rulesmd.ini`: ```ini [General] -DefaultToGuardArea=false ; boolean +DefaultToGuardArea=false ; boolean +KeepAlive.SupportInfantrys=false ; boolean +KeepAlive.SupportVehicles=false ; boolean +KeepAlive.SupportAircrafts=false ; boolean +KeepAlive.SupportBuildings=false ; boolean [CombatDamage] Warhead.PreventScatter=false ; boolean diff --git a/docs/Whats-New.md b/docs/Whats-New.md index fd4878f814..cb4a863daa 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -844,6 +844,7 @@ HideShakeEffects=false ; boolean - Removed the restriction that prohibits InfantryTypes from using the InitialPayload logic (by Noble_Fish) - `ProjectileRange` now has weapon range modifiers applied to it if greater than 0 and unless `ProjectileRange.ApplyModifiers` is set to false on the WeaponType (by Starkku) - Allowed customizing the default value of `[Warhead] -> PreventScatter` via `[CombatDamage] -> Warhead.PreventScatter` (by Noble_Fish) +- Ares' `KeepAlive` adds global tags (by FlyStar) ``` ```{dropdown} Pre-release changes diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index e0d7f53ac5..a4401d52a0 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -610,6 +610,11 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->ReadyToNextMission_MovingCheck.Read(exINI, GameStrings::General, "ReadyToNextMission.MovingCheck"); this->Warhead_PreventScatter.Read(exINI, GameStrings::CombatDamage, "Warhead.PreventScatter"); + + this->KeepAlive_SupportInfantrys.Read(exINI, GameStrings::General, "KeepAlive.SupportInfantrys"); + this->KeepAlive_SupportVehicles.Read(exINI, GameStrings::General, "KeepAlive.SupportVehicles"); + this->KeepAlive_SupportAircrafts.Read(exINI, GameStrings::General, "KeepAlive.SupportAircrafts"); + this->KeepAlive_SupportBuildings.Read(exINI, GameStrings::General, "KeepAlive.SupportBuildings"); // Section AITargetTypes int itemsCount = pINI->GetKeyCount("AITargetTypes"); @@ -1087,6 +1092,10 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->NoAlphaImageOnBuildup) .Process(this->ReadyToNextMission_MovingCheck) .Process(this->Warhead_PreventScatter) + .Process(this->KeepAlive_SupportInfantrys) + .Process(this->KeepAlive_SupportVehicles) + .Process(this->KeepAlive_SupportAircrafts) + .Process(this->KeepAlive_SupportBuildings) ; } diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index 076d0d2ee6..7dfc7e6a16 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -534,6 +534,11 @@ class RulesExt Valueable NoAlphaImageOnBuildup; Valueable Warhead_PreventScatter; + + Valueable KeepAlive_SupportInfantrys; + Valueable KeepAlive_SupportVehicles; + Valueable KeepAlive_SupportAircrafts; + Valueable KeepAlive_SupportBuildings; ExtData(RulesClass* OwnerObject) : Extension(OwnerObject) , Storage_TiberiumIndex { -1 } @@ -1003,6 +1008,11 @@ class RulesExt , NoAlphaImageOnBuildup { false } , ReadyToNextMission_MovingCheck { false } , Warhead_PreventScatter { false } + + , KeepAlive_SupportInfantrys { false } + , KeepAlive_SupportVehicles { false } + , KeepAlive_SupportAircrafts { false } + , KeepAlive_SupportBuildings { true } { } virtual ~ExtData() = default; diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index b903cd3e35..9f76a2f170 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -1206,6 +1206,7 @@ void TechnoTypeExt::LoadFromINIFile(CCINIClass* const pINI) // Ares 3.0 this->Unsellable.Read(exINI, pSection, "Unsellable"); + this->KeepAlive.Read(exINI, pSection, "KeepAlive"); if (pThis->Gunner) { @@ -1804,6 +1805,7 @@ void TechnoTypeExt::Serialize(T& Stm) .Process(this->JumpjetClimbIgnoreBuilding) .Process(this->Unsellable) + .Process(this->KeepAlive) .Process(this->ExtraThreat_Enabled) .Process(this->ExtraThreat_IsThreat) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index e4ee3ab3e7..01f5586b55 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -438,7 +438,8 @@ class TechnoTypeExt : public ObjectTypeExt Valueable Convert_Health_BelowPercent; Nullable Convert_Health; - Nullable Unsellable; // Ares 3.0 + Nullable Unsellable; // Ares 3.0 + Nullable KeepAlive; // Ares 3.0 TechnoTypeExt(TechnoTypeClass* OwnerObject) : ObjectTypeExt(OwnerObject) , HealthBar_Hide { false } @@ -814,6 +815,7 @@ class TechnoTypeExt : public ObjectTypeExt , JumpjetClimbIgnoreBuilding {} , Unsellable {} + , KeepAlive {} , ExtraThreat_Enabled { false } , ExtraThreat_IsThreat {} diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index 1bed9df103..72d05079ee 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -177,6 +177,63 @@ static bool __fastcall ParadropPlaneUnlimbo(AircraftClass* pThis, void* _, const #pragma endregion +#pragma region AresKeepAlive + +struct AresHouseExt +{ + char _[0x18]; + int KeepAliveTechnos; + int KeepAliveBuildings; +}; + +static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, void*, TechnoClass* const pTechno, const AbstractType rtti, const bool add) +{ + bool keepAlive = false; + bool result = false; + auto const pType = pTechno->GetTechnoType(); + + if (!pType->Insignificant && !pType->DontScore) + { + switch (rtti) + { + case AbstractType::Infantry: + keepAlive = RulesExt::Global()->KeepAlive_SupportInfantrys; + break; + case AbstractType::Unit: + keepAlive = RulesExt::Global()->KeepAlive_SupportVehicles; + break; + case AbstractType::Aircraft: + keepAlive = RulesExt::Global()->KeepAlive_SupportAircrafts; + break; + case AbstractType::Building: + keepAlive = RulesExt::Global()->KeepAlive_SupportBuildings; + break; + default: + break; + } + + result = true; + } + + const Nullable& keepAliveValue = TechnoTypeExt::Fetch(pType)->KeepAlive; + + if (keepAliveValue.isset()) + keepAlive = keepAliveValue.Get(); + + if (keepAlive) + { + const int number = add ? 1 : -1; + pExt_Ares->KeepAliveTechnos += number; + + if (rtti == AbstractType::Building) + pExt_Ares->KeepAliveBuildings += number; + } + + return result; +} + +#pragma endregion + DEFINE_HOOK(0x440580, BuildingClass_Unlimbo_UnitDeliveryFix, 0x5) { if (UnitDeliveryTemp::Placing) @@ -307,6 +364,9 @@ void Apply_Ares3_0_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x4CE84, &BuildingExt::UpdateFactoryQueues); Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x4ADE0, GET_OFFSET(AresPreventScatter_Override)); + + // Ares' `KeepAlive` adds global tags. + Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x21F70, GET_OFFSET(AresHouseExt_UpdateKeepAlive)); } void Apply_Ares3_0p1_Patches() @@ -420,4 +480,7 @@ void Apply_Ares3_0p1_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x4DAF4, &BuildingExt::UpdateFactoryQueues); Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x4BA40, GET_OFFSET(AresPreventScatter_Override)); + + // Ares' `KeepAlive` adds global tags. + Patch::Apply_LJMP(AresHelper::AresBaseAddress + 0x229F0, GET_OFFSET(AresHouseExt_UpdateKeepAlive)); } From 49fa407820dd698b07c5cd55ee88f92de6390b37 Mon Sep 17 00:00:00 2001 From: Fly-Star <100747645+a851903106@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:12:35 +0800 Subject: [PATCH 3/7] doc fix --- docs/Fixed-or-Improved-Logics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 66fbb8c42e..eec71ae16c 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -543,7 +543,7 @@ DefaultToGuardArea=false ; boolean KeepAlive.SupportInfantrys=false ; boolean KeepAlive.SupportVehicles=false ; boolean KeepAlive.SupportAircrafts=false ; boolean -KeepAlive.SupportBuildings=false ; boolean +KeepAlive.SupportBuildings=true ; boolean [CombatDamage] Warhead.PreventScatter=false ; boolean From ef3667515f0e8a97bc1f26788b44dc57b8608636 Mon Sep 17 00:00:00 2001 From: Fly-Star <100747645+a851903106@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:14:04 +0800 Subject: [PATCH 4/7] Update Hooks.Ares.cpp --- src/Misc/Hooks.Ares.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index 72d05079ee..f98b6b01f0 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -215,12 +215,9 @@ static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, voi result = true; } - const Nullable& keepAliveValue = TechnoTypeExt::Fetch(pType)->KeepAlive; + auto const pTypeExt = TechnoTypeExt::Fetch(pType); - if (keepAliveValue.isset()) - keepAlive = keepAliveValue.Get(); - - if (keepAlive) + if (pTypeExt->KeepAlive.Get(keepAlive)) { const int number = add ? 1 : -1; pExt_Ares->KeepAliveTechnos += number; From 3c79c5ee42097cd18933bb978eb5130684f8c7f6 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Mon, 17 Aug 2026 19:46:22 +0800 Subject: [PATCH 5/7] correct Changelog entry position --- docs/Whats-New.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Whats-New.md b/docs/Whats-New.md index c90439884a..38db9d6dea 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -428,6 +428,7 @@ HideShakeEffects=false ; boolean #### Fixes / interactions with other extensions: - Allowed `SW.ShowCameo` and `SW.ManualFire` to work independently of `SW.AutoFire` (by Noble_Fish) +- Ares' `KeepAlive` adds global tags (by FlyStar) ``` @@ -861,7 +862,6 @@ HideShakeEffects=false ; boolean - Removed the restriction that prohibits InfantryTypes from using the InitialPayload logic (by Noble_Fish) - `ProjectileRange` now has weapon range modifiers applied to it if greater than 0 (by Starkku) - Allowed customizing the default value of `[Warhead] -> PreventScatter` via `[CombatDamage] -> Warhead.PreventScatter` (by Noble_Fish) -- Ares' `KeepAlive` adds global tags (by FlyStar) ``` ```{dropdown} Pre-release changes From d81dcbacdb4eb645e36a2dd114ac75ff1a792b8c Mon Sep 17 00:00:00 2001 From: Coronia <2217891145@qq.com> Date: Thu, 20 Aug 2026 11:46:05 +0800 Subject: [PATCH 6/7] change tag pattern --- docs/Fixed-or-Improved-Logics.md | 11 ++++++----- src/Ext/Rules/Body.cpp | 18 ++++++++++-------- src/Ext/Rules/Body.h | 18 ++++++++++-------- src/Misc/Hooks.Ares.cpp | 19 ++++++++++++------- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index f697f429c4..ff8d45e319 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -541,11 +541,12 @@ Unless otherwise specified, after removing the last dot and everything before it In `rulesmd.ini`: ```ini [General] -DefaultToGuardArea=false ; boolean -KeepAlive.SupportInfantrys=false ; boolean -KeepAlive.SupportVehicles=false ; boolean -KeepAlive.SupportAircrafts=false ; boolean -KeepAlive.SupportBuildings=true ; boolean +DefaultToGuardArea=false ; boolean +KeepAlive.Buildings=true ; boolean +KeepAlive.Defenses=true ; boolean +KeepAlive.Infantry=false ; boolean +KeepAlive.Units=false ; boolean +KeepAlive.Aircraft=false ; boolean [CombatDamage] Warhead.PreventScatter=false ; boolean diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index 77443b0889..5ca0495370 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -611,10 +611,11 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->Warhead_PreventScatter.Read(exINI, GameStrings::CombatDamage, "Warhead.PreventScatter"); - this->KeepAlive_SupportInfantrys.Read(exINI, GameStrings::General, "KeepAlive.SupportInfantrys"); - this->KeepAlive_SupportVehicles.Read(exINI, GameStrings::General, "KeepAlive.SupportVehicles"); - this->KeepAlive_SupportAircrafts.Read(exINI, GameStrings::General, "KeepAlive.SupportAircrafts"); - this->KeepAlive_SupportBuildings.Read(exINI, GameStrings::General, "KeepAlive.SupportBuildings"); + this->KeepAlive_Infantry.Read(exINI, GameStrings::General, "KeepAlive.Infantry"); + this->KeepAlive_Units.Read(exINI, GameStrings::General, "KeepAlive.Units"); + this->KeepAlive_Aircraft.Read(exINI, GameStrings::General, "KeepAlive.Aircraft"); + this->KeepAlive_Buildings.Read(exINI, GameStrings::General, "KeepAlive.Buildings"); + this->KeepAlive_Defenses.Read(exINI, GameStrings::General, "KeepAlive.Defenses"); this->ProjectileRange_ApplyModifiers.Read(exINI, GameStrings::CombatDamage, "ProjectileRange.ApplyModifiers"); @@ -1095,10 +1096,11 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->ReadyToNextMission_MovingCheck) .Process(this->Warhead_PreventScatter) .Process(this->ProjectileRange_ApplyModifiers) - .Process(this->KeepAlive_SupportInfantrys) - .Process(this->KeepAlive_SupportVehicles) - .Process(this->KeepAlive_SupportAircrafts) - .Process(this->KeepAlive_SupportBuildings) + .Process(this->KeepAlive_Infantry) + .Process(this->KeepAlive_Units) + .Process(this->KeepAlive_Aircraft) + .Process(this->KeepAlive_Buildings) + .Process(this->KeepAlive_Defenses) ; } diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index f30b592fbe..df77ce69ba 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -535,10 +535,11 @@ class RulesExt Valueable Warhead_PreventScatter; - Valueable KeepAlive_SupportInfantrys; - Valueable KeepAlive_SupportVehicles; - Valueable KeepAlive_SupportAircrafts; - Valueable KeepAlive_SupportBuildings; + Valueable KeepAlive_Infantry; + Valueable KeepAlive_Units; + Valueable KeepAlive_Aircraft; + Valueable KeepAlive_Buildings; + Valueable KeepAlive_Defenses; Valueable ProjectileRange_ApplyModifiers; @@ -1015,10 +1016,11 @@ class RulesExt , ProjectileRange_ApplyModifiers { true } - , KeepAlive_SupportInfantrys { false } - , KeepAlive_SupportVehicles { false } - , KeepAlive_SupportAircrafts { false } - , KeepAlive_SupportBuildings { true } + , KeepAlive_Infantry { false } + , KeepAlive_Units { false } + , KeepAlive_Aircraft { false } + , KeepAlive_Buildings { true } + , KeepAlive_Defenses { true } { } virtual ~ExtData() = default; diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index cc5218ab9e..384bb9f0cc 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -190,23 +190,30 @@ static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, voi { bool keepAlive = false; bool result = false; - auto const pType = pTechno->GetTechnoType(); + auto const pTypeExt = TechnoExt::Fetch(pTechno)->TypeExtData; + auto const pType = pTypeExt->OwnerObject(); if (!pType->Insignificant && !pType->DontScore) { switch (rtti) { case AbstractType::Infantry: - keepAlive = RulesExt::Global()->KeepAlive_SupportInfantrys; + keepAlive = RulesExt::Global()->KeepAlive_Infantry; break; case AbstractType::Unit: - keepAlive = RulesExt::Global()->KeepAlive_SupportVehicles; + keepAlive = RulesExt::Global()->KeepAlive_Units; break; case AbstractType::Aircraft: - keepAlive = RulesExt::Global()->KeepAlive_SupportAircrafts; + keepAlive = RulesExt::Global()->KeepAlive_Aircraft; break; case AbstractType::Building: - keepAlive = RulesExt::Global()->KeepAlive_SupportBuildings; + auto const pBuildingType = static_cast(pType); + + if (pBuildingType->BuildCat == BuildCat::Combat) + keepAlive = RulesExt::Global()->KeepAlive_Defenses; + else + keepAlive = RulesExt::Global()->KeepAlive_Buildings; + break; default: break; @@ -215,8 +222,6 @@ static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, voi result = true; } - auto const pTypeExt = TechnoTypeExt::Fetch(pType); - if (pTypeExt->KeepAlive.Get(keepAlive)) { const int number = add ? 1 : -1; From 6d4f22f812e7e99c19dc0beef19f966e5d021f01 Mon Sep 17 00:00:00 2001 From: Coronia <2217891145@qq.com> Date: Thu, 20 Aug 2026 11:54:51 +0800 Subject: [PATCH 7/7] fix --- src/Misc/Hooks.Ares.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index 384bb9f0cc..a232481964 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -198,15 +198,22 @@ static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, voi switch (rtti) { case AbstractType::Infantry: + { keepAlive = RulesExt::Global()->KeepAlive_Infantry; break; + } case AbstractType::Unit: + { keepAlive = RulesExt::Global()->KeepAlive_Units; break; + } case AbstractType::Aircraft: + { keepAlive = RulesExt::Global()->KeepAlive_Aircraft; break; + } case AbstractType::Building: + { auto const pBuildingType = static_cast(pType); if (pBuildingType->BuildCat == BuildCat::Combat) @@ -215,9 +222,12 @@ static bool __fastcall AresHouseExt_UpdateKeepAlive(AresHouseExt* pExt_Ares, voi keepAlive = RulesExt::Global()->KeepAlive_Buildings; break; + } default: + { break; } + } result = true; }