mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 09:55:36 +00:00
Add another note in [test_condition] for a simple case of using [have_location] to verify that a hex has a particular terrain
This commit is contained in:
parent
3e31fdb7fb
commit
f473aabe99
@ -11,6 +11,15 @@ local extra_templates = {
|
||||
args.actual = tostring(wml.variables[cfg.name])
|
||||
return 'Note: The variable $varname currently has the value $actual.'
|
||||
end,
|
||||
have_location = function(cfg, args)
|
||||
if type(cfg.x) == 'number' and type(cfg.y) == 'number' and cfg.terrain then
|
||||
args.x = cfg.x
|
||||
args.y = cfg.y
|
||||
args.terrain = wesnoth.get_terrain(cfg.x, cfg.y)
|
||||
return 'Note: ($x,$y) has terrain $terrain.'
|
||||
end
|
||||
return ''
|
||||
end,
|
||||
}
|
||||
|
||||
local function stringize(tag, cfg, parse)
|
||||
|
Loading…
x
Reference in New Issue
Block a user