Files
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

47 lines
1.7 KiB
Plaintext

modded class ERR_RoadblockMine
{
void ERR_Diag()
{
vector actor;
if (m_Actor) actor = m_Actor.GetOrigin();
if (m_Actor && m_Utility)
{
AIAgent agent = SCR_AIUtils.GetAIAgent(m_Actor);
if (agent) PrintFormat("ERR MINE DIAG ACTION lod=%1 active=%2 current=%3 executing=%4 requested=%5", agent.GetLOD(), agent.IsAIActivated(), m_Utility.GetCurrentAction(), m_Utility.GetExecutedAction(), m_Action);
}
bool armed;
if (m_Trigger) armed = m_Trigger.IsActivated();
PrintFormat("ERR MINE DIAG JOB state=%1 stopped=%2 actor=%3 site=%4 dist=%5 armed=%6 owned=%7", m_State, m_Stopped, actor, m_Position, vector.DistanceXZ(actor, m_Position), armed, Owned());
}
}
modded class ERR_RoadblockMining
{
float m_ERRDiag;
override void Tick(array<ref ERR_HQUnit> units, array<IEntity> attempted, float now)
{
super.Tick(units, attempted, now);
if (now < m_ERRDiag) return;
m_ERRDiag = now + 10000;
PrintFormat("ERR MINE DIAG TICK posts=%1 units=%2", m_Posts.Count(), units.Count());
foreach (ERR_RoadblockMinePost post : m_Posts)
{
PrintFormat("ERR MINE DIAG POST attempts=%1 jobs=%2", post.Attempts, post.Jobs.Count());
foreach (ERR_RoadblockMine job : post.Jobs) job.ERR_Diag();
}
}
}
modded class ArmaReforgerScripted
{
float m_ERRMineElapsed;
bool m_ERRMineDone;
float m_ERRMineNext;
override void OnUpdate(BaseWorld world, float timeslice)
{
super.OnUpdate(world, timeslice);
if (m_ERRMineDone || !ERR_GameMode.Get() || !ERR_GameMode.Get().Active()) return;
m_ERRMineElapsed += timeslice;
if (m_ERRMineElapsed >= m_ERRMineNext) { m_ERRMineNext = m_ERRMineElapsed + 1; ERR_GameMode.Get().Command().Tick(world.GetWorldTime()); }
if (m_ERRMineElapsed >= 200) { Print("ERR MINE DIAG COMPLETE"); m_ERRMineDone = true; }
}
}