Added small test for argument passing to Lua code.
This commit is contained in:
parent
918e27f8b8
commit
7913dfc335
1 changed files with 7 additions and 2 deletions
|
@ -277,9 +277,14 @@ Xu , Xu , Qxu , Qxu , Ql , Ql
|
|||
name=prestart
|
||||
[lua]
|
||||
code=<<
|
||||
local team = wesnoth.get_side(1);
|
||||
team.gold = team.gold + 500;
|
||||
local args = ...
|
||||
local team = wesnoth.get_side(args.side);
|
||||
team.gold = team.gold + args.gold;
|
||||
>>
|
||||
[args]
|
||||
side=1
|
||||
gold=500
|
||||
[/args]
|
||||
[/lua]
|
||||
[set_menu_item]
|
||||
description="Calculate unit worth"
|
||||
|
|
Loading…
Add table
Reference in a new issue