Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix #7944: Demolishing locks built on rivers didn't always restore the river #7946
It works for the flat water because...
The lower and upper tiles of the lock are getting WaterClass after the clear command in the case of object on river (rocky land). In Test mode, the WaterClass becomes WATER_CLASS_CANAL by failing IsWaterTile check, because the clear command was also in test mode. But in Exec mode, the tile resulting by the clear command is a river tile, without the rocks, WaterClass then is WATER_CLASS_RIVER.
Then when removing the lock,
In short, DC_TEST and DC_EXEC are being toyed around with the WaterClass for the upper/lower tiles. The middle tile is not. WaterClass is being checked before the clear command. For a river with rocks on it, IsTileWater test false, thus WaterClass for middle tile is WATER_CLASS_CANAL, but for HasTileWaterGround it returns WATER_CLASS_RIVER.