(fc5e081d3) Fixed: Hull names not saving properly in submarineditor

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:31:32 +03:00
parent 50dc08fb56
commit fc22eb5088
24 changed files with 350 additions and 782 deletions
@@ -88,6 +88,21 @@ namespace Barotrauma
}
}
public override void Update(float deltaTime)
{
if (objectiveManager.CurrentObjective == this)
{
if (randomTimer > 0)
{
randomTimer -= deltaTime;
}
else
{
SetRandom();
}
}
}
public override bool IsCompleted() => false;
public override bool CanBeCompleted => true;
@@ -316,8 +331,16 @@ namespace Barotrauma
{
if (hull == null) { return true; }
string hullName = hull.RoomName?.ToLowerInvariant();
if (hullName == null) { return false; }
return hullName.Contains("ballast") || hullName.Contains("airlock");
bool isForbidden = hullName == "ballast" || hullName == "airlock";
foreach (Item item in Item.ItemList)
{
if (item.CurrentHull == hull && (item.HasTag("ballast") || item.HasTag("airlock")))
{
isForbidden = true;
break;
}
}
return isForbidden;
}
public override bool IsDuplicate(AIObjective otherObjective)