Revert "Fixes a crash when an entity goes off-grid. (hehe)"
This reverts commit 3967ecf098.
This commit is contained in:
@@ -88,10 +88,14 @@ namespace Content.Shared.Physics.Controllers
|
||||
[Pure]
|
||||
private float GetTileFriction(IPhysBody body)
|
||||
{
|
||||
if (body.BodyStatus == BodyStatus.InAir || !_mapManager.TryGetGrid(body.Owner.Transform.GridID, out var grid))
|
||||
if (body.BodyStatus == BodyStatus.InAir || body.Entity.Transform.GridID == GridId.Invalid)
|
||||
return 0.0f;
|
||||
|
||||
var tile = grid.GetTileRef(body.Owner.Transform.Coordinates);
|
||||
var transform = body.Owner.Transform;
|
||||
var coords = transform.Coordinates;
|
||||
|
||||
var grid = _mapManager.GetGrid(coords.GetGridId(body.Owner.EntityManager));
|
||||
var tile = grid.GetTileRef(coords);
|
||||
var tileDef = _tileDefinitionManager[tile.Tile.TypeId];
|
||||
return tileDef.Friction;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user