From 5983e492a0ec9f192b5ff6ee66d0fd57af8c7ac6 Mon Sep 17 00:00:00 2001
From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Date: Mon, 10 Jan 2022 15:04:01 +1300
Subject: [PATCH] Make more item slot data-fields read-only. (#6058)
---
Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs
index 3def5a2e54..41cfd479cc 100644
--- a/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs
+++ b/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs
@@ -93,13 +93,18 @@ namespace Content.Shared.Containers.ItemSlots
/// This will be passed through Loc.GetString. If the name is an empty string, then verbs will use the name
/// of the currently held or currently inserted entity instead.
///
- [DataField("name")]
+ [DataField("name", readOnly: true)]
public string Name = string.Empty;
///
/// The entity prototype that is spawned into this slot on map init.
///
- [DataField("startingItem", customTypeSerializer: typeof(PrototypeIdSerializer))]
+ ///
+ /// Marked as readOnly because some components (e.g. PowerCellSlot) set the starting item based on some
+ /// property of that component (e.g., cell slot size category), and this can lead to unnecessary changes
+ /// when mapping.
+ ///
+ [DataField("startingItem", readOnly: true, customTypeSerializer: typeof(PrototypeIdSerializer))]
public string? StartingItem;
///