Change Gen4 roamer default met tile

the groundtile bit permission was causing the Route 201 to set Water which isn't possible to encounter them on, so use the lowest bit instead of highest bit
This commit is contained in:
Kurt 2023-08-17 08:45:30 -07:00
parent bfc24dd5c2
commit ff3081408a

View File

@ -54,13 +54,12 @@ public static class GroundTileAllowedExtensions
/// </summary>
/// <param name="permit">Tile bit-permission value</param>
/// <param name="value">Tile type to check.</param>
/// <returns></returns>
public static bool Contains(this GroundTileAllowed permit, GroundTileType value) => (permit & (GroundTileAllowed)(1 << (int)value)) != 0;
/// <summary>
/// Grabs the highest set bit from the tile value.
/// Grabs the lowest set bit from the tile value.
/// </summary>
/// <param name="permit">Tile bit-permission value</param>
/// <returns>Bit index</returns>
public static GroundTileType GetIndex(this GroundTileAllowed permit) => (GroundTileType)System.Numerics.BitOperations.Log2((uint)permit);
public static GroundTileType GetIndex(this GroundTileAllowed permit) => (GroundTileType)System.Numerics.BitOperations.Log2((uint)(permit & ~(permit - 1)));
}