(a17abe3fa) Remove a not so useful loop from a method, which might be used often.

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:25:12 +03:00
parent 52d3737416
commit e500ba2bdf
28 changed files with 400 additions and 244 deletions
@@ -73,6 +73,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;
@@ -301,15 +316,7 @@ namespace Barotrauma
{
if (hull == null) { return true; }
string hullName = hull.RoomName?.ToLowerInvariant();
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;
}
}
bool isForbidden = hullName.Contains("ballast") || hullName.Contains("airlock");
return isForbidden;
}