You're welcome. I'm still puzzled as to why there is a tile prototype with a nil value for that field.
I also suspect that this part of your code could be using game.get_filtered_tile_prototypes
, though it's in initialization code and so likely shouldn't matter much. I think though that globals might be one of the things that's part of the shared state, and I don't know that your list of the waterness of all tiles needs to be there.
I couldn't get get_filtered_tile_prototypes
to work correctly though, and so I confined my surgery on your mod to the change I just showed you. :-)