Entity: an equipped item keeps the hardpoint it occupies
The placement rule (HardpointAt) already finds the one hardpoint an item lies in at equip; TryEquip threw that answer away and eighteen readers recomputed it from the item's origin cell, which need not lie in the hardpoint (Soul's scenarios batch-4 P30). EquippedItem.Hardpoint now carries the answer, null for Tool gear and the hull, and every origin-cell lookup reads it instead: FireControl.ArcFor, the eleven weapon managers, EntityInstance, ShipInstance and ActionGameManager's articulation grouping. Entity.Hardpoints[,] stays the per-cell map for armour and display. TryFindSpace's hardpoint search tries every origin the fit rule can accept, including ones up and left of the hardpoint, so a design whose shape lacks its origin cell is found wherever ItemFits would place it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2d39c83504
commit
5ea59ac6b5
15 changed files with 45 additions and 33 deletions
|
|
@ -1053,12 +1053,12 @@ public class ActionGameManager : MonoBehaviour
|
|||
_articulationGroups = CurrentEntity.Equipment
|
||||
.Where(item => item.Behaviors.Any(x => x.Data is WeaponData && !(x.Data is LauncherData)))
|
||||
.GroupBy(item => ZoneRenderer.EntityInstances[CurrentEntity]
|
||||
.GetBarrel(CurrentEntity.Hardpoints[item.Position.x, item.Position.y])
|
||||
.GetBarrel(item.Hardpoint)
|
||||
.GetComponentInParent<ArticulationPoint>()?.Group ?? -1)
|
||||
.Select((group, index) => {
|
||||
return (
|
||||
group.Select(item => CurrentEntity.Hardpoints[item.Position.x, item.Position.y]).ToArray(),
|
||||
group.Select(item => ZoneRenderer.EntityInstances[CurrentEntity].GetBarrel(CurrentEntity.Hardpoints[item.Position.x, item.Position.y])).ToArray(),
|
||||
group.Select(item => item.Hardpoint).ToArray(),
|
||||
group.Select(item => ZoneRenderer.EntityInstances[CurrentEntity].GetBarrel(item.Hardpoint)).ToArray(),
|
||||
Crosshairs[index]
|
||||
);
|
||||
}).ToArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue