Advertisement
Vultraz

Untitled

Jan 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1.  
  2. function wesnoth.wml_conditionals.lua(cfg)
  3.     cfg = helper.shallow_literal(cfg)
  4.     local bytecode, message = load(cfg.code or "")
  5.  
  6.     if not bytecode then
  7.         error("~lua:" .. message, 0)
  8.         return false
  9.     else
  10.         return ~~bytecode(helper.get_child(cfg, "args"))
  11.     end
  12. end
  13.         [if]
  14.             [lua]
  15.                 code = <<
  16.                     return wesnoth.variables["foo"] == "test"
  17.                 >>
  18.             [/lua]
  19.             [then]
  20.                 [message]
  21.                     speaker=narrator
  22.                     message="condition passed"
  23.                 [/message]
  24.             [/then]
  25.         [/if]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement