Use non-generic TryComp() for metadata & transform (#28133)
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Content.Server.Gravity
|
||||
private void OnComponentShutdown(EntityUid uid, GravityGeneratorComponent component, ComponentShutdown args)
|
||||
{
|
||||
if (component.GravityActive &&
|
||||
TryComp<TransformComponent>(uid, out var xform) &&
|
||||
TryComp(uid, out TransformComponent? xform) &&
|
||||
TryComp(xform.ParentUid, out GravityComponent? gravity))
|
||||
{
|
||||
component.GravityActive = false;
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.Gravity
|
||||
UpdateUI(ent, chargeRate);
|
||||
|
||||
if (active != gravGen.GravityActive &&
|
||||
TryComp<TransformComponent>(uid, out var xform) &&
|
||||
TryComp(uid, out TransformComponent? xform) &&
|
||||
TryComp<GravityComponent>(xform.ParentUid, out var gravity))
|
||||
{
|
||||
// Force it on in the faster path.
|
||||
|
||||
Reference in New Issue
Block a user