Cut 0: give Entity its own EntitySettings copy, delete the duplicate copies
Entity's constructor now takes a MessagePack round-trip copy of the settings it is given, so no entity can alias GameplaySettings.DefaultEntitySettings. That makes ActionGameManager.NewEntitySettings and EntitySerializer.Unpack's null-coalescing copy redundant; both are deleted, and TradeMenu buys a ship straight off the template (Entity's ctor copies it). EntitiesDoNotShareDefaultEntitySettings pins the invariant: writing ShutdownPerformance on one ship must not move the default for a sibling or the template (settings-globals-cut.md, Cut 0). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
52011771bd
commit
0c2da217f3
5 changed files with 30 additions and 9 deletions
|
|
@ -374,7 +374,7 @@ public class TradeMenu : MonoBehaviour
|
|||
{
|
||||
if (hullData.HullType != HullType.Ship) throw new ArgumentException("Attempted to buy non-ship hull from station, WTF are you doing?!");
|
||||
|
||||
var ship = new Ship(GameManager.ItemManager, GameManager.Zone, item as EquippableItem, GameManager.NewEntitySettings) { IsPlayerShip = true };
|
||||
var ship = new Ship(GameManager.ItemManager, GameManager.Zone, item as EquippableItem, GameManager.ItemManager.GameplaySettings.DefaultEntitySettings) { IsPlayerShip = true };
|
||||
ship.SetParent(GameManager.DockedEntity);
|
||||
|
||||
GameManager.Credits -= data.Price;
|
||||
|
|
|
|||
Loading…
Reference in a new issue