DaleStan wrote:It never occurs today, but that's not what we're trying to guard against. What happens when a version 6 or 7 grf is loaded in a game with at least 32 height levels?
I'd say that clamping is the least bad solution for those NewGRFs. For GRFv8 we intend to use the number of height levels instead of pixels when returning heights (including snow lines). So we don't use more bits for the return value. The variable will just return the height level for version 8 instead of height level in pixels for versions before 8.
So for a GRFv7 you'd get 0, 8, 16, 24, ..., for GRFv8 you'd get 0, 1, 2, 3, ... There is, however, a problem with clamping height levels (in pixels) as they would not allow distinguishing between 32 or 64. But what if the snow level is 64? Then it'd return FE for the height level of the snow, and for anything from 32-64 the NewGRF would think it is snowy. We could make the height levels somewhat related to the snow level, so you return 0 for height levels 0-48, use 08..FD for 49-79, and FE for 80 and higher.
The major caveat with that is things that want to, e.g., build at height level 1. That wouldn't work anymore.
So all in all I'd say: for GRF versions before 8 use heightlevel in pixels clamped to FE. For GRF version 8 use the actual height level as number.