diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 7d8970caf..7c3db5202 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -382,7 +382,7 @@ namespace Barotrauma if (commands.Length>1) float.TryParse(commands[1], out power); var reactor = reactorItem.GetComponent(); - reactor.ShutDownTemp = 7000.0f; + reactor.ShutDownTemp = power == 0 ? 0 : 7000.0f; reactor.AutoTemp = true; reactor.Temperature = power; break; diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs index 816a015db..341690f5c 100644 --- a/Subsurface/Source/Items/CharacterInventory.cs +++ b/Subsurface/Source/Items/CharacterInventory.cs @@ -413,20 +413,11 @@ namespace Barotrauma } } - //for (int i = 0; i < capacity; i++) - //{ - // slotRect.X = (int)(SlotPositions[i].X + offset.X); - // slotRect.Y = (int)(SlotPositions[i].Y + offset.Y); - // slotRect.Width = 40; - // slotRect.Height = 40; - if (selectedSlot > -1) { DrawSubInventory(spriteBatch, highlightedSlot, selectedSlot); } - //} - slotRect.Width = rectWidth; slotRect.Height = rectHeight; @@ -437,6 +428,24 @@ namespace Barotrauma if (draggingItem == null) return; + var rootContainer = draggingItem.GetRootContainer(); + var rootInventory = draggingItem.ParentInventory; + + if (rootContainer != null) + { + rootInventory = rootContainer.ParentInventory != null ? + rootContainer.ParentInventory : rootContainer.GetComponent().Inventory; + } + + if (rootInventory != null && + rootInventory.Owner != Character.Controlled && + rootInventory.Owner != Character.Controlled.SelectedConstruction && + rootInventory.Owner != Character.Controlled.SelectedCharacter) + { + draggingItem = null; + return; + } + if (!draggingItemSlot.Contains(PlayerInput.MousePosition)) { if (PlayerInput.LeftButtonHeld()) diff --git a/Subsurface/Source/Items/Components/Wearable.cs b/Subsurface/Source/Items/Components/Wearable.cs index 36539d95e..b86459917 100644 --- a/Subsurface/Source/Items/Components/Wearable.cs +++ b/Subsurface/Source/Items/Components/Wearable.cs @@ -178,12 +178,12 @@ namespace Barotrauma.Items.Components PlaySound(ActionType.OnWearing, picker.WorldPosition); - if (containedItems == null) return; - for (int j = 0; j < containedItems.Length; j++) - { - if (containedItems[j] == null) continue; - containedItems[j].ApplyStatusEffects(ActionType.OnWearing, deltaTime, picker); - } + //if (containedItems == null) return; + //for (int j = 0; j < containedItems.Length; j++) + //{ + // if (containedItems[j] == null) continue; + // containedItems[j].ApplyStatusEffects(ActionType.OnWearing, deltaTime, picker); + //} } protected override void RemoveComponentSpecific()