Fix AI con crashes (#2119)
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Drink
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (!target.TryGetComponent(out SolutionContainerComponent drink))
|
||||
if (target.Deleted || !target.TryGetComponent(out SolutionContainerComponent drink))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Food
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (!target.TryGetComponent(out SolutionContainerComponent food))
|
||||
if (target.Deleted || !target.TryGetComponent(out SolutionContainerComponent food))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user