Added "user" parameter to Inventory.PutItem and Inventory.TryPutItem. + More descriptive wiring logging: the logs don't list all the wires in a connectionpanel but only the changes a player does to the wiring. Disconnecting wires by picking them up and wiring done by the host are also logged now.

This commit is contained in:
Joonas Rikkonen
2017-07-17 23:27:31 +03:00
parent f1edb14f3f
commit 575b643c62
16 changed files with 125 additions and 66 deletions
@@ -46,7 +46,7 @@ namespace Barotrauma
{
if (!character.SelectedItems.Contains(weapon))
{
character.Inventory.TryPutItem(weapon, 3, false);
character.Inventory.TryPutItem(weapon, 3, false, character);
weapon.Equip(character);
}
character.CursorPosition = enemy.Position;
@@ -83,7 +83,7 @@ namespace Barotrauma
if (character.Inventory.Items[i] == null) continue;
//try to move the existing item to LimbSlot.Any and continue if successful
if (character.Inventory.TryPutItem(character.Inventory.Items[i], new List<InvSlotType>() { InvSlotType.Any })) continue;
if (character.Inventory.TryPutItem(character.Inventory.Items[i], character, new List<InvSlotType>() { InvSlotType.Any })) continue;
//if everything else fails, simply drop the existing item
character.Inventory.Items[i].Drop();
@@ -95,7 +95,7 @@ namespace Barotrauma
if (targetSlot > -1 && character.Inventory.IsInLimbSlot(targetItem, InvSlotType.Any))
{
character.Inventory.TryPutItem(targetItem, targetSlot, false);
character.Inventory.TryPutItem(targetItem, targetSlot, false, character);
}
}
else
@@ -576,7 +576,7 @@ namespace Barotrauma
if (item == null) continue;
item.TryInteract(this, true, true, true);
inventory.TryPutItem(item, i, false, false);
inventory.TryPutItem(item, i, false, null, false);
}
}
}
@@ -162,7 +162,7 @@ namespace Barotrauma
for (int i = 0; i < character.Inventory.Items.Length; i++)
{
if (character.Inventory.Items[i] == null) continue;
husk.Inventory.TryPutItem(character.Inventory.Items[i], i, true);
husk.Inventory.TryPutItem(character.Inventory.Items[i], i, true, null);
}
character.Enabled = false;
@@ -117,11 +117,11 @@ namespace Barotrauma
List<InvSlotType> allowedSlots = new List<InvSlotType>(item.AllowedSlots);
allowedSlots.Remove(InvSlotType.Any);
character.Inventory.TryPutItem(item, allowedSlots);
character.Inventory.TryPutItem(item, null, allowedSlots);
}
else
{
character.Inventory.TryPutItem(item, item.AllowedSlots);
character.Inventory.TryPutItem(item, null, item.AllowedSlots);
}
if (item.Prefab.Name == "ID Card" && spawnPoint != null)