OnWearing statuseffects aren't applied to items contained inside a worn item, dragging an item is canceled if deselecting the inventory the item is in

This commit is contained in:
Regalis
2016-05-07 09:19:32 +03:00
parent d5f6fff2c2
commit be3d418297
3 changed files with 25 additions and 16 deletions
+1 -1
View File
@@ -382,7 +382,7 @@ namespace Barotrauma
if (commands.Length>1) float.TryParse(commands[1], out power);
var reactor = reactorItem.GetComponent<Reactor>();
reactor.ShutDownTemp = 7000.0f;
reactor.ShutDownTemp = power == 0 ? 0 : 7000.0f;
reactor.AutoTemp = true;
reactor.Temperature = power;
break;
+18 -9
View File
@@ -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<Items.Components.ItemContainer>().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())
@@ -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()