forked from github/server
bugfix: use_item scripts must return a value
This commit is contained in:
parent
5b5026cefd
commit
77bc58aabd
3 changed files with 8 additions and 2 deletions
|
@ -6,7 +6,9 @@ function use_seashell(u, amount)
|
|||
local msg = message("msg_event")
|
||||
msg:set_string("string", tostring(u) .. " erzählt den Bewohnern von " .. r.name .. " von Muschelplateau, das seine Partei vor " .. turns .. " Wochen besucht hat." )
|
||||
msg:send_region(u.region)
|
||||
return 0
|
||||
end
|
||||
return -4
|
||||
end
|
||||
|
||||
function update_embassies()
|
||||
|
|
|
@ -4,7 +4,9 @@ function use_snomwan(u, amount)
|
|||
u.race = "snowman"
|
||||
u.number = amount
|
||||
u:add_item("snowman", -amount)
|
||||
return 0
|
||||
end
|
||||
return -4
|
||||
end
|
||||
|
||||
function xmas2004()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function usepotion_message(u, type)
|
||||
function usepotion_message(u, potion)
|
||||
msg = message("usepotion")
|
||||
msg:set_unit("unit", u)
|
||||
msg:set_resource("potion", type)
|
||||
msg:set_resource("potion", potion)
|
||||
return msg
|
||||
end
|
||||
|
||||
|
@ -11,6 +11,8 @@ function use_stardust(u, amount)
|
|||
u.region:set_resource("peasant", p)
|
||||
local msg = usepotion_message(u, "stardust")
|
||||
msg:send_region(u.region)
|
||||
u:add_item("stardust", -amount)
|
||||
return 0
|
||||
end
|
||||
|
||||
function xmas2005()
|
||||
|
|
Loading…
Reference in a new issue