unify Weapon and StationWeapon components

This commit is contained in:
2026-05-22 22:06:30 +02:00
parent bd488db8ef
commit ea79d76953
7 changed files with 89 additions and 157 deletions

View File

@@ -114,7 +114,7 @@ void ArenaSimulation::placeStructures()
auto placeArenaStation = [&](const ArenaStationEntry& entry, bool isEnemy)
{
float hp = 0.0f;
StationWeapon weapon;
Weapon weapon;
weapon.cooldownTicks = 0.0f;
weapon.currentTarget = std::nullopt;
const double lv = static_cast<double>(entry.level);
@@ -155,7 +155,7 @@ void ArenaSimulation::placeStructures()
}
const entt::entity stationEntity = m_admin.spawnStation(
anchor, parsed.footprint, absCells, hp, hp, isEnemy);
m_admin.addComponent<StationWeapon>(stationEntity, weapon);
m_admin.addComponent<Weapon>(stationEntity, weapon);
m_buildingSystem->registerTileOccupancy(absCells, allocateId());
};
@@ -500,3 +500,4 @@ void ArenaSimulation::updateStatus()
std::lock_guard<std::mutex> lock(m_statusMutex);
m_status = newStatus;
}