Adding a new `TileDirection.INVALID` value causes existing code to crash
I attempted to add TileDirection.INVALID, and without changing any other code, the game crashes with the following error when trying to move a unit to a new tile:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Invalid TileDirection')
at C7GameData.Tile.HasRiverCrossing(TileDirection dir)
This is strange because I did not reference the INVALID enum anywhere in code other than adding it to the enum declaration.
I imagine some code is iterating over the enum values and calling HasRiverCrossing for each. It's probably a good idea for most enums to have a default or invalid value though.
Looks like it's GameMap's computeNeighbors. Should be easy to add a check if you want to add an Invalid TileDirection
Good find. I wonder if there's a common pattern to deal with this kind of thing.