Open pcen opened 1 year ago
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.
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:This is strange because I did not reference the
INVALID
enum anywhere in code other than adding it to the enum declaration.