- Callback 2F (I doubt it)
- Advanced var2s
- Industry tile var 60
- My brain
I suspect it's probably the last; that is not unprecedented, especially when attempting to report bugs in Csaba's features.
But anyway:
Code: Select all
97 * 34 02 09 EB 81 60 00 33 1F 00 60 00 60 FF 0F 10 01 60 10 33 1F 01 60 10 40 FF 0F 10 01 01 FF 00 00 00 FF
98 * 15 02 09 EC 81 60 10 08 01 01 01 FF 00 00 EB 00
99 * 34 02 09 ED 81 60 00 33 1F 00 60 00 60 FF 0F 10 01 60 01 33 1F 01 60 01 40 FF 0F 10 01 EC 00 00 00 00 FF
100 * 15 02 09 EE 81 60 01 08 01 01 EC 00 00 00 ED 00
101 * 15 02 09 EF 81 60 00 00 10 01 EE 00 00 00 00 FF
Sprite 101 is correctly failing the construction on steep slopes, but sprites 97..100 don't seem to be working correctly.
100: If tile at 01 is the part of the same industry as the current tile, goto 99, else goto 98.
99: If high corner of current tile and tile at 01 are at the same height, goto 97, else fail:
-- 60 00 33 1F: height level (0..16; each landscape step is 1) of low corner of current tile
-- 00 60 00 60 FF 0F 10: add 1 if this tile is sloped
-- 01 60 01 33 1F: subtract height level of low corner of tile at 01
-- 01 60 01 60 FF 0F 10: subtract another 1 if tile at 01 is sloped
-- 01 EC 00 00 00 00 FF: goto 98 if the result is 0, else fail construction.
98,97: repeat 100,99 for tile at 10; except "permit construction" instead of "goto".
Checking the tiles at (+1,0) and (0,+1) should be sufficient for enforcing "Industry must end up flat", but something's clearly wrong, because the only rule that actually gets enforced is "Industry must not be built on steep slopes."
If I set the "01 FF" in sprite 98 to "00 FF", construction will always fail. The same is *not* true of the "01 FF" in sprite 97; AFAICT, the same thing happens regardless of what values sprite 97 returns.
GRF attached (win version)