Fix AI shutting storage crash (#1344)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-07-11 01:27:36 +10:00
committed by GitHub
parent 915fffb635
commit 2e6661e885
3 changed files with 6 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
using System;
using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States.Utility;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.AI.Utility.Considerations.State
{
@@ -20,7 +21,8 @@ namespace Content.Server.AI.Utility.Considerations.State
protected override float GetScore(Blackboard context)
{
var stateData = context.GetState<StoredStateIsNullState>().GetValue();
return stateData == null ? 1.0f : 0.0f;
context.GetStoredState(stateData, out StoredStateData<IEntity> state);
return state.GetValue() == null ? 1.0f : 0.0f;
}
}
}