Merge pull request #745 from GregoryLundberg/GL_do_not_select_unit_in_silent_object
Do not select unit in silent object
This commit is contained in:
commit
70131ec7f1
1 changed files with 8 additions and 6 deletions
|
@ -24,6 +24,10 @@ function wml_actions.object(cfg)
|
|||
unit = wesnoth.get_unit(context.x1, context.y1)
|
||||
end
|
||||
|
||||
-- Default to silent if object has no description
|
||||
local silent = cfg.silent
|
||||
if silent == nil then silent = (text:len() == 0) end
|
||||
|
||||
-- If a unit matches the filter, proceed
|
||||
if unit then
|
||||
text = tostring(cfg.description or "")
|
||||
|
@ -41,8 +45,10 @@ function wml_actions.object(cfg)
|
|||
wesnoth.add_modification(unit, "object", helper.parsed(cfg), add)
|
||||
end
|
||||
|
||||
wesnoth.select_unit(unit, false)
|
||||
wesnoth.highlight_hex(unit.x, unit.y)
|
||||
if not silent then
|
||||
wesnoth.select_unit(unit, false)
|
||||
wesnoth.highlight_hex(unit.x, unit.y)
|
||||
end
|
||||
|
||||
-- Mark this item as used up
|
||||
if obj_id and unique then used_items[obj_id] = true end
|
||||
|
@ -51,10 +57,6 @@ function wml_actions.object(cfg)
|
|||
command_type = "else"
|
||||
end
|
||||
|
||||
-- Default to silent if object has no description
|
||||
local silent = cfg.silent
|
||||
if silent == nil then silent = (text:len() == 0) end
|
||||
|
||||
if not silent then
|
||||
wml_actions.redraw{}
|
||||
local name = tostring(cfg.name or "")
|
||||
|
|
Loading…
Add table
Reference in a new issue