Zini wrote:But do Morrowind.esm interior cells even have water by default? I would expect you need to set it with the SetWaterLevel instruction first.
There is a flag for interiors to indicate if they have water.
SetWaterLevel defaults to -128, even if the cell doesn't have any water. There is a patch for the game engine that does change this I think because detecting if an interior cell has water was fairly problematic (You had to use sounds).
Right. So I think the right behaviour would be to check this flag (in the CELL record). If it is unset, no water at all (we can add script functions to change that in post-1.0 development).
If it is set the water level in the CellStore data structure should be set to the default value. SetWaterLevel and GetWaterLevel are working on this value and ignore the water flag.
The renderer checks the water flag and if it is set, it renders as the hight given in the CellStore.
According to http://www.mwmythicmods.com/argent/tech/es_format.html the WGHT (water height) record is a float, and not int. The ESM reader was reading it as int. After changing it to float I've got water showing up in interiors.
I have no clue though why only I had this problem.
Mostly. Modifying the water levels in exteriors doesn't make sense in the current implementation. I think OpSetWaterLevel and OpModWaterLevel should throw an exception when executed while in an exterior cell.