- npcs wont try grab items from other characters' inventories

- fixed lightcomponent LightSprites "twitching" when the sub is moving
- fixed null reference exceptions in Hull.Render if no submarine has been loaded
- submarine descriptions
- emergency sirens in Aegir & Vellamo
- changed the required item for fabricating a wire from "Copper" to "Copper Bar"
This commit is contained in:
Regalis
2016-03-18 17:48:25 +02:00
parent 8df9864db9
commit fc8b30c974
18 changed files with 158 additions and 82 deletions
@@ -111,7 +111,6 @@ namespace Barotrauma
for (int i = 0; i < 5 && currSearchIndex < Item.ItemList.Count - 2; i++)
{
currSearchIndex++;
var item = Item.ItemList[currSearchIndex];
@@ -119,8 +118,16 @@ namespace Barotrauma
if (item.CurrentHull == null || item.Condition <= 0.0f) continue;
if (IgnoreContainedItems && item.Container != null) continue;
if (item.Name != itemName && !item.HasTag(itemName)) continue;
//if the item is inside a character's inventory, don't steal it
if (item.ParentInventory is CharacterInventory) continue;
//if the item is inside an item, which is inside a character's inventory, don't steal it
if (item.ParentInventory != null && item.ParentInventory.Owner is Item)
{
if (((Item)item.ParentInventory.Owner).ParentInventory is CharacterInventory) continue;
}
//ignore if item is further away than the currently targeted item
Item rootContainer = item.GetRootContainer();
if (moveToTarget != null && Vector2.DistanceSquared((rootContainer ?? item).Position, character.Position) > currDist) continue;