fix issue where repair behavior targets enemy HQ in balancing target

This commit is contained in:
2026-06-19 21:36:04 +02:00
parent 9573b9789a
commit 4818997164
3 changed files with 58 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
#include "EntityAdmin.h"
#include "FactionComponent.h"
#include "HealthComponent.h"
#include "HqProxyComponent.h"
#include "ModuleOwnerComponent.h"
#include "MovementIntentSystem.h"
#include "PositionComponent.h"
@@ -121,6 +122,8 @@ void ArenaSimulation::placeStructures()
}
m_team1HqEntity = m_admin.spawnStation(anchor, hqParsed.footprint, absCells,
hp, hp, false);
// Tag as an HQ so it is excluded from repair targeting (REQ-SHP-REPAIR).
m_admin.addComponent<HqProxyComponent>(m_team1HqEntity);
m_buildingSystem->registerTileOccupancy(absCells, allocateBuildingId());
}
@@ -140,6 +143,8 @@ void ArenaSimulation::placeStructures()
}
m_team2HqEntity = m_admin.spawnStation(anchor, hqParsed.footprint, absCells,
hp, hp, true);
// Tag as an HQ so it is excluded from repair targeting (REQ-SHP-REPAIR).
m_admin.addComponent<HqProxyComponent>(m_team2HqEntity);
m_buildingSystem->registerTileOccupancy(absCells, allocateBuildingId());
}