Item.Container bugfix (affected at least railguns in MP), merged the "your crew has died" message box with shiftsummary, reliable reactor syncing, prevent artifacts dropping out of the level

This commit is contained in:
Regalis
2016-01-12 01:02:05 +02:00
parent 64e62545a5
commit 5513637fe5
21 changed files with 132 additions and 89 deletions
+27 -9
View File
@@ -61,11 +61,29 @@ namespace Barotrauma
private bool inWater;
//the inventory in which the item is contained in
public Inventory inventory;
private Inventory inventory;
//the inventory in which the item is contained in
public Inventory Inventory
{
get
{
return inventory;
}
set
{
inventory = value;
if (inventory != null) Container = inventory.Owner as Item;
}
}
public Item Container
{
get;
private set;
}
public Item container;
public List<FixRequirement> FixRequirements;
public override string Name
@@ -354,7 +372,7 @@ namespace Barotrauma
if (c == null) return;
c.RemoveContained(contained);
contained.container = null;
contained.Container = null;
}
@@ -517,7 +535,7 @@ namespace Barotrauma
//effect.Apply(type, deltaTime, null, Character);
//ApplyStatusEffect(effect, type, deltaTime, null, Character, limb);
if (container != null && effect.Targets.HasFlag(StatusEffect.TargetType.Parent)) targets.Add(container);
if (Container != null && effect.Targets.HasFlag(StatusEffect.TargetType.Parent)) targets.Add(Container);
//{
// effect.Apply(type, deltaTime, container);
// //container.ApplyStatusEffect(effect, type, deltaTime, container);
@@ -558,7 +576,7 @@ namespace Barotrauma
}
ic.WasUsed = false;
if (container != null) ic.ApplyStatusEffects(ActionType.OnContained, deltaTime);
if (Container != null) ic.ApplyStatusEffects(ActionType.OnContained, deltaTime);
if (!ic.IsActive) continue;
@@ -1005,7 +1023,7 @@ namespace Barotrauma
}
}
if (container!=null) container.RemoveContained(this);
if (Container!=null) Container.RemoveContained(this);
return true;
}
@@ -1079,7 +1097,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components) ic.Drop(dropper);
if (container != null) container.RemoveContained(this);
if (Container != null) Container.RemoveContained(this);
}
public void Equip(Character character)