public static bool CheckTileObstruction(ref Vector2f position, Person person)
{
int tw = _map.Tileset.TileWidth, th = _map.Tileset.TileHeight;
int sx = (int)position.X / tw + 2;
int sy = (int)position.Y / th + 2;
Vector2f pos = new Vector2f();
for (var y = sy - 2; y < sy; ++y)
{
pos.Y = y * th;
for (var x = sx - 2; x < sx; ++x)
{
pos.X = x * tw;
int t = _map.Layers[person.Layer].GetTile(x, y);
if (t >= 0 && person.CheckObstructions(ref position, ref pos, _map.Tileset.Tiles[t]))
return true;
}
}
return false;
}