Unstable v0.1100.0.4 (November 11th 2020)

This commit is contained in:
Joonas Rikkonen
2020-11-06 20:12:15 +02:00
parent 6b36bf809d
commit b772654326
297 changed files with 12502 additions and 4277 deletions
@@ -33,6 +33,9 @@ namespace Barotrauma.Items.Components
{
return;
}
if (holdable == null) { return; }
deattachTimer = Math.Max(0.0f, value);
#if SERVER
if (deattachTimer >= DeattachDuration)
@@ -57,7 +60,7 @@ namespace Barotrauma.Items.Components
public bool Attached
{
get { return holdable == null ? false : holdable.Attached; }
get { return holdable != null && holdable.Attached; }
}
public LevelResource(Item item, XElement element) : base(item, element)
@@ -67,7 +70,7 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
if (!holdable.Attached)
if (holdable != null && !holdable.Attached)
{
trigger.Enabled = false;
IsActive = false;
@@ -87,7 +90,6 @@ namespace Barotrauma.Items.Components
holdable = item.GetComponent<Holdable>();
if (holdable == null)
{
DebugConsole.ThrowError("Error while initializing item \"" + item.Name + "\". Level resources require a Holdable component.");
IsActive = false;
return;
}