Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add wesnoth.terrain_mask lua function
`[terrain_mask]` had multiple unexpected behviours, see for example #3364 in parituclar `wesnoth.wml_actions.terrain_mask { x =2, y=2, mask="Ww"}` will change the tile at (1,2) instead of (2,2), so instead of reusing the old terrain mask code i wrote a new function that behaves as one would expect. `wesnoth.terrain_mask` does not have a `border=` parameter but a `is_odd` parameter that specifies that a map is in the odd format __ __ /00\__/20\__ \__/10\__/30\ /01\__/21\__/ \__/11\__/31\ /02\__/22\__/ \__/ \__/ instead of the even map format __ __ __/10\__/30\ /00\__/20\__/ \__/11\__/31\ /01\__/21\__/ \__/12\__/32\ \__/ \__/ (Monospaced font required to see ascii images.) The lua function also has a lua interfacte, meaning it does not take wml tables but normal lua tables making it easier to use from lua code. (cherry-picked from commit a3367ee)
- Loading branch information
Showing
6 changed files
with
222 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters