Fix IsBlockedTurf throwing when entities do not have a PhysicsComponent (#8170)
This commit is contained in:
committed by
GitHub
parent
af575323c1
commit
4a1b4fb18c
@@ -200,7 +200,10 @@ namespace Content.Shared.Maps
|
||||
|
||||
foreach (var ent in query)
|
||||
{
|
||||
var body = entManager.GetComponent<PhysicsComponent>(ent);
|
||||
// Yes, this can fail. Welp!
|
||||
if (!entManager.TryGetComponent(ent, out PhysicsComponent? body))
|
||||
continue;
|
||||
|
||||
if (body.CanCollide && body.Hard && (body.CollisionLayer & (int) CollisionGroup.Impassable) != 0)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user