Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wesnoth.wml_conditionals.lua(cfg)
- cfg = helper.shallow_literal(cfg)
- local bytecode, message = load(cfg.code or "")
- if not bytecode then
- error("~lua:" .. message, 0)
- return false
- else
- return ~~bytecode(helper.get_child(cfg, "args"))
- end
- end
- [if]
- [lua]
- code = <<
- return wesnoth.variables["foo"] == "test"
- >>
- [/lua]
- [then]
- [message]
- speaker=narrator
- message="condition passed"
- [/message]
- [/then]
- [/if]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement