Fix nullable build errors (#1849)
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Content.Server.AI.Operators.Inventory
|
|||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!container.Owner.TryGetComponent(out EntityStorageComponent storageComponent) ||
|
if (!container.Owner.TryGetComponent(out EntityStorageComponent? storageComponent) ||
|
||||||
storageComponent.IsWeldedShut)
|
storageComponent.IsWeldedShut)
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Server.AI.Operators.Inventory
|
|||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_owner.TryGetComponent(out HandsComponent handsComponent))
|
if (!_owner.TryGetComponent(out HandsComponent? handsComponent))
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ namespace Content.Server.AI.Operators.Inventory
|
|||||||
public override Outcome Execute(float frameTime)
|
public override Outcome Execute(float frameTime)
|
||||||
{
|
{
|
||||||
// TODO: Also have this check storage a la backpack etc.
|
// TODO: Also have this check storage a la backpack etc.
|
||||||
if (!_owner.TryGetComponent(out HandsComponent handsComponent))
|
if (!_owner.TryGetComponent(out HandsComponent? handsComponent))
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_target.TryGetComponent(out ItemComponent itemComponent))
|
if (!_target.TryGetComponent(out ItemComponent? itemComponent))
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
_owner = owner;
|
_owner = owner;
|
||||||
_target = target;
|
_target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Outcome Execute(float frameTime)
|
public override Outcome Execute(float frameTime)
|
||||||
{
|
{
|
||||||
if (_interactionCooldown >= 0)
|
if (_interactionCooldown >= 0)
|
||||||
@@ -29,11 +29,11 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
_interactionCooldown -= frameTime;
|
_interactionCooldown -= frameTime;
|
||||||
return Outcome.Continuing;
|
return Outcome.Continuing;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Also have this check storage a la backpack etc.
|
// TODO: Also have this check storage a la backpack etc.
|
||||||
if (_target.Deleted ||
|
if (_target.Deleted ||
|
||||||
!_owner.TryGetComponent(out HandsComponent handsComponent) ||
|
!_owner.TryGetComponent(out HandsComponent? handsComponent) ||
|
||||||
!_target.TryGetComponent(out ItemComponent itemComponent))
|
!_target.TryGetComponent(out ItemComponent? itemComponent))
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
@@ -58,10 +58,10 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drinkComponent.Deleted ||
|
if (drinkComponent.Deleted ||
|
||||||
drinkComponent.Empty ||
|
drinkComponent.Empty ||
|
||||||
_owner.TryGetComponent(out ThirstComponent thirstComponent) &&
|
_owner.TryGetComponent(out ThirstComponent? thirstComponent) &&
|
||||||
thirstComponent.CurrentThirst >= thirstComponent.ThirstThresholds[ThirstThreshold.Okay])
|
thirstComponent.CurrentThirst >= thirstComponent.ThirstThresholds[ThirstThreshold.Okay])
|
||||||
{
|
{
|
||||||
return Outcome.Success;
|
return Outcome.Success;
|
||||||
@@ -70,4 +70,4 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
return Outcome.Continuing;
|
return Outcome.Continuing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
_interactionCooldown -= frameTime;
|
_interactionCooldown -= frameTime;
|
||||||
return Outcome.Continuing;
|
return Outcome.Continuing;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Also have this check storage a la backpack etc.
|
// TODO: Also have this check storage a la backpack etc.
|
||||||
if (_target.Deleted ||
|
if (_target.Deleted ||
|
||||||
!_owner.TryGetComponent(out HandsComponent handsComponent) ||
|
!_owner.TryGetComponent(out HandsComponent? handsComponent) ||
|
||||||
!_target.TryGetComponent(out ItemComponent itemComponent))
|
!_target.TryGetComponent(out ItemComponent? itemComponent))
|
||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
@@ -58,10 +58,10 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
{
|
{
|
||||||
return Outcome.Failed;
|
return Outcome.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_target.Deleted ||
|
if (_target.Deleted ||
|
||||||
foodComponent.UsesRemaining == 0 ||
|
foodComponent.UsesRemaining == 0 ||
|
||||||
_owner.TryGetComponent(out HungerComponent hungerComponent) &&
|
_owner.TryGetComponent(out HungerComponent? hungerComponent) &&
|
||||||
hungerComponent.CurrentHunger >= hungerComponent.HungerThresholds[HungerThreshold.Okay])
|
hungerComponent.CurrentHunger >= hungerComponent.HungerThresholds[HungerThreshold.Okay])
|
||||||
{
|
{
|
||||||
return Outcome.Success;
|
return Outcome.Success;
|
||||||
@@ -70,4 +70,4 @@ namespace Content.Server.AI.Operators.Nutrition
|
|||||||
return Outcome.Continuing;
|
return Outcome.Continuing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user