(30308f7e4) Fixed players being able to overwrite vanilla content when the vanilla package is not selected
This commit is contained in:
@@ -284,22 +284,25 @@ namespace Barotrauma
|
||||
|
||||
Lights.LightManager.ViewTarget = this;
|
||||
CharacterHUD.Update(deltaTime, this, cam);
|
||||
|
||||
if (hudProgressBars.Any())
|
||||
|
||||
bool removeProgressBars = false;
|
||||
|
||||
foreach (HUDProgressBar progressBar in hudProgressBars.Values)
|
||||
{
|
||||
foreach (var progressBar in hudProgressBars)
|
||||
if (progressBar.FadeTimer <= 0.0f)
|
||||
{
|
||||
if (progressBar.Value.FadeTimer <= 0.0f)
|
||||
{
|
||||
progressBarRemovals.Add(progressBar);
|
||||
continue;
|
||||
}
|
||||
progressBar.Value.Update(deltaTime);
|
||||
removeProgressBars = true;
|
||||
continue;
|
||||
}
|
||||
if (progressBarRemovals.Any())
|
||||
progressBar.Update(deltaTime);
|
||||
}
|
||||
|
||||
if (removeProgressBars)
|
||||
{
|
||||
// TODO: this generates garbage, can we fix anything here?
|
||||
foreach (var pb in hudProgressBars.Where(pb => pb.Value.FadeTimer <= 0.0f).ToList())
|
||||
{
|
||||
progressBarRemovals.ForEach(pb => hudProgressBars.Remove(pb.Key));
|
||||
progressBarRemovals.Clear();
|
||||
hudProgressBars.Remove(pb.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Barotrauma
|
||||
if (vanillaContent == null)
|
||||
{
|
||||
// TODO: Dynamic method for defining and finding the vanilla content package.
|
||||
vanillaContent = SelectedPackages.SingleOrDefault(cp => Path.GetFileName(cp.Path).ToLowerInvariant() == "vanilla 0.9.xml");
|
||||
vanillaContent = ContentPackage.List.SingleOrDefault(cp => Path.GetFileName(cp.Path).ToLowerInvariant() == "vanilla 0.9.xml");
|
||||
}
|
||||
return vanillaContent;
|
||||
}
|
||||
|
||||
@@ -198,6 +198,7 @@ namespace Barotrauma
|
||||
|
||||
private void FindTargetHulls()
|
||||
{
|
||||
var idCard = character.Inventory.FindItemByIdentifier("idcard");
|
||||
bool isCurrentHullOK = !HumanAIController.UnsafeHulls.Contains(character.CurrentHull) && !IsForbidden(character.CurrentHull);
|
||||
|
||||
targetHulls.Clear();
|
||||
|
||||
Reference in New Issue
Block a user