Simplified syntax for wml_actions.chat()
This commit is contained in:
parent
a273be5520
commit
f8c811fa4f
1 changed files with 1 additions and 7 deletions
|
@ -60,16 +60,10 @@ end
|
|||
|
||||
function wml_actions.chat(cfg)
|
||||
local side_list = wesnoth.get_sides(cfg)
|
||||
local speaker = tostring(cfg.speaker) or "WML"
|
||||
local message = tostring(cfg.message) or
|
||||
helper.wml_error "[chat] missing required message= attribute."
|
||||
|
||||
local speaker = cfg.speaker
|
||||
if speaker then
|
||||
speaker = tostring(speaker)
|
||||
else
|
||||
speaker = "WML"
|
||||
end
|
||||
|
||||
for index, side in ipairs(side_list) do
|
||||
if side.controller == "human" then
|
||||
wesnoth.message(speaker, message)
|
||||
|
|
Loading…
Add table
Reference in a new issue