Use non-generic TryComp() for metadata & transform (#28133)

This commit is contained in:
Leon Friedrich
2024-05-21 17:40:35 +12:00
committed by GitHub
parent 3b61368946
commit 0f6e1196d8
38 changed files with 65 additions and 65 deletions

View File

@@ -570,7 +570,7 @@ namespace Content.Shared.Interaction
Ignored? predicate = null,
bool popup = false)
{
if (!TryComp<TransformComponent>(other, out var otherXform))
if (!TryComp(other, out TransformComponent? otherXform))
return false;
return InRangeUnobstructed(origin, other, otherXform.Coordinates, otherXform.LocalRotation, range, collisionMask, predicate,
@@ -633,7 +633,7 @@ namespace Content.Shared.Interaction
fixtureA.FixtureCount > 0 &&
TryComp<FixturesComponent>(other, out var fixtureB) &&
fixtureB.FixtureCount > 0 &&
TryComp<TransformComponent>(origin, out var xformA))
TryComp(origin, out TransformComponent? xformA))
{
var (worldPosA, worldRotA) = xformA.GetWorldPositionRotation();
var xfA = new Transform(worldPosA, worldRotA);