Unstable 1.8.4.0
This commit is contained in:
+4
-2
@@ -59,13 +59,15 @@ namespace Barotrauma
|
||||
|
||||
protected override bool IsValidTarget(Item target)
|
||||
{
|
||||
if (target == null || target.Removed) { return false; }
|
||||
// If the target was selected as a valid target, we'll have to accept it so that the objective can be completed.
|
||||
// The validity changes when a character picks the item up.
|
||||
if (!IsValidTarget(target, character, checkInventory: true))
|
||||
{
|
||||
return Objectives.ContainsKey(target) && AIObjectiveCleanupItems.IsItemInsideValidSubmarine(target, character);
|
||||
}
|
||||
if (target.CurrentHull.FireSources.Count > 0) { return false; }
|
||||
//note that the item can be outside hulls and still be a valid target - it can be in the character's inventory
|
||||
if (target.CurrentHull != null && target.CurrentHull.FireSources.Count > 0) { return false; }
|
||||
|
||||
foreach (Character c in Character.CharacterList)
|
||||
{
|
||||
@@ -96,7 +98,7 @@ namespace Barotrauma
|
||||
|
||||
private static bool IsValidTarget(Item item, Character character, bool checkInventory)
|
||||
{
|
||||
if (item == null) { return false; }
|
||||
if (item == null || item.Removed) { return false; }
|
||||
if (item.GetRootInventoryOwner() == character) { return true; }
|
||||
return AIObjectiveCleanupItems.IsValidTarget(
|
||||
item,
|
||||
|
||||
Reference in New Issue
Block a user