Nullability fixes.
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Content.Server.Body
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent body))
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent? body))
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";
|
||||
@@ -72,7 +72,7 @@ namespace Content.Server.Body
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent body))
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent? body))
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";
|
||||
@@ -119,7 +119,7 @@ namespace Content.Server.Body
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent body))
|
||||
if (!player.AttachedEntity.TryGetComponent(out BodyManagerComponent? body))
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.Body.Mechanisms.Behaviors
|
||||
base.PreMetabolism(frameTime);
|
||||
|
||||
if (Mechanism.Body == null ||
|
||||
!Mechanism.Body.Owner.TryGetComponent(out BloodstreamComponent bloodstream))
|
||||
!Mechanism.Body.Owner.TryGetComponent(out BloodstreamComponent? bloodstream))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Body.Mechanisms.Behaviors
|
||||
base.PreMetabolism(frameTime);
|
||||
|
||||
if (Mechanism.Body == null ||
|
||||
!Mechanism.Body.Owner.TryGetComponent(out LungComponent lung))
|
||||
!Mechanism.Body.Owner.TryGetComponent(out LungComponent? lung))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Server.Body.Mechanisms.Behaviors
|
||||
base.PreMetabolism(frameTime);
|
||||
|
||||
if (Mechanism.Body == null ||
|
||||
!Mechanism.Body.Owner.TryGetComponent(out StomachComponent stomach))
|
||||
!Mechanism.Body.Owner.TryGetComponent(out StomachComponent? stomach))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user