From 807ec876941762c043d3c27d0f23232bf25cfb16 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 5 Apr 2018 13:45:21 +0300 Subject: [PATCH] Fixed items in cloned/copypasted inventories not being saved. Closes #342 and #38 --- Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs b/Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs index e8eef30d1..75da4d56e 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs @@ -142,7 +142,10 @@ namespace Barotrauma PlayerInput.GetKeyboardState.IsKeyDown(Keys.V) && PlayerInput.GetOldKeyboardState.IsKeyUp(Keys.V)) { - var clones = Clone(copiedList); + List prevEntities = new List(mapEntityList); + Clone(copiedList); + + var clones = mapEntityList.Except(prevEntities).ToList(); Vector2 center = Vector2.Zero; clones.ForEach(c => center += c.WorldPosition);