Skip to content
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed building and defense tab hotkeys not enabling the placement mode after *Cannot build here.* triggered and the placement mode cancelled.
- Fixed buildings with `UndeployInto` playing `EVA_NewRallypointEstablished` on undeploying.
- Fixed buildings with `Naval=yes` ignoring `WaterBound=no` to be forced to place onto water.
- Fixed AI-controlled buildings continuing production while under EMP effect. Now freezes factory production progress for AI-owned buildings during EMP until the effect wears off.
- Fixed AI Aircraft docks bug when Ares tag `[GlobalControls] -> AllowParallelAIQueues=no` is set.
- Fixed laser drawing code to allow for thicker lasers in house color draw mode.
- Fixed `DeathWeapon` not detonating properly.
Expand Down
19 changes: 19 additions & 0 deletions src/Ext/Techno/Body.Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <Ext/Scenario/Body.h>
#include <Utilities/EnumFunctions.h>
#include <Utilities/AresFunctions.h>
#include <BuildingClass.h>
#include <FactoryClass.h>


// TechnoClass_AI_0x6F9E50
Expand Down Expand Up @@ -1638,6 +1640,23 @@ void TechnoExt::ExtData::UpdateRearmInEMPState()

if (pThis->ReloadTimer.InProgress() && pTypeExt->NoReload_UnderEMP.Get(RulesExt::Global()->NoReload_UnderEMP))
pThis->ReloadTimer.StartTime++;

// Freeze AI-controlled factory production while building is EMPed
if (pThis->IsUnderEMP() && pThis->WhatAmI() == AbstractType::Building)
{
auto const pBuilding = static_cast<BuildingClass*>(pThis);

if (pBuilding->Owner && !pBuilding->Owner->IsControlledByHuman())
{
if (auto const pFactory = pBuilding->Factory)
{
if (pFactory->Object && pFactory->Production.Rate > 0)
{
pFactory->Production.Timer.StartTime++;
}
}
}
}
}

void TechnoExt::ExtData::UpdateRearmInTemporal()
Expand Down