make repair ships standby with rest of fleet if there is no one to repair (instead of advancing towards the enemy stations)

This commit is contained in:
2026-06-18 21:43:55 +02:00
parent abab2bbb6e
commit c371b43a6d
14 changed files with 208 additions and 4 deletions

View File

@@ -25,6 +25,7 @@
#include "SalvageScrapBehavior.h"
#include "SelectedBehaviorComponent.h"
#include "SensorRangeComponent.h"
#include "StandbyBehavior.h"
#include "Tick.h"
#include "tracing.h"
#include "WeaponComponent.h"
@@ -401,6 +402,11 @@ entt::entity ShipSystem::spawn(const std::string& schematicId, int level,
repair.orbitRadius_tiles =
maxRepairRange * static_cast<float>(m_config.world.orbitFactor);
m_admin.addComponent<RepairBehavior>(entity, repair);
// Repair-capable ships hold with the fleet (REQ-SHP-STANDBY) instead of
// charging the enemy when no more urgent behavior applies; this applies
// whether or not the ship also carries weapons.
m_admin.addComponent<StandbyBehavior>(entity, StandbyBehavior{});
}
return entity;