diff --git a/CREDITS.md b/CREDITS.md index 52e0977bf5..ee5006106b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -643,3 +643,5 @@ This page lists all the individual contributions to the project by their author. - **Damfoos** - extensive and thorough testing - **Dmitry Volkov** - extensive and thorough testing - **Rise of the East community** - extensive playtesting of in-dev features +- **ahasasjeb**: + - Fixed AI continuing to produce units and construct buildings from buildings affected by EMP \ No newline at end of file diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 9c0586bd77..53ad910677 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -261,6 +261,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - `DeployingAnim` now supports both `Normalized=true` and `Reverse=true`. Keep in mind `Reverse` uses `LoopEnd` for frame amount instead of `End` even without `LoopCount` > 1. - `DeployingAnim` using unit drawer now also tint accordingly with the unit. - Fixed the bug that armor multiplier of new attacheffect will have extra take effect once if restricted warheads. +- Fixed AI continuing to produce units and construct buildings from buildings affected by EMP. ## Fixes / interactions with other extensions diff --git a/docs/Whats-New.md b/docs/Whats-New.md index cd865f0c19..66ca4ae3d2 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -439,6 +439,7 @@ New: - [Customize hardcoded projectile initial facing behavior](Fixed-or-Improved-Logics.md#customizing-initial-facing-behavior) (by Starkku) - Health bar permanently displayed (by FlyStar) - [`IsSimpleDeployer` facing customization & directional deploy animations](Fixed-or-Improved-Logics.md#issimpleDeployer-facing-and-animation-customization) (by Starkku) +- Fixed AI continuing to produce units and construct buildings from buildings affected by EMP. (by ahasasjeb) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/src/Ext/Techno/Body.Update.cpp b/src/Ext/Techno/Body.Update.cpp index f41d25f7f5..787ae3752e 100644 --- a/src/Ext/Techno/Body.Update.cpp +++ b/src/Ext/Techno/Body.Update.cpp @@ -10,14 +10,17 @@ #include #include #include +#include +#include + +#include +#include #include #include #include #include #include -#include -#include // TechnoClass_AI_0x6F9E50 @@ -1638,6 +1641,21 @@ void TechnoExt::ExtData::UpdateRearmInEMPState() if (pThis->ReloadTimer.InProgress() && pTypeExt->NoReload_UnderEMP.Get(RulesExt::Global()->NoReload_UnderEMP)) pThis->ReloadTimer.StartTime++; + + // Pause building factory production under EMP / Deactivated (AI only) + if (auto const pBuilding = abstract_cast(pThis)) + { + if (pBuilding->Owner && !pBuilding->Owner->IsControlledByHuman()) + { + if (auto const pFactory = pBuilding->Factory) + { + if (pFactory->Production.Timer.InProgress()) + { + pFactory->Production.Timer.StartTime++; + } + } + } + } } void TechnoExt::ExtData::UpdateRearmInTemporal()