Hunter MAI: add syntax translation and deprecation message

So that the ai_type=hunter_unit syntax still works for the time being.
This commit is contained in:
mattsc 2013-10-25 16:03:11 -07:00
parent d6db87f7c0
commit c6e8f69d57

View file

@ -148,6 +148,13 @@ function wesnoth.wml_actions.micro_ai(cfg)
cfg.guardian_type = nil
end
-- Add translation for old-syntax hunter_unit MAI to new syntax plus deprecation message
if (cfg.ai_type == 'hunter_unit') then
wesnoth.message("'ai_type=hunter_unit' is deprecated. Use 'ai_type=hunter' instead.")
cfg.ai_type = 'hunter'
end
-- Check that the required common keys are all present and set correctly
if (not cfg.ai_type) then H.wml_error("[micro_ai] is missing required ai_type= key") end
if (not cfg.side) then H.wml_error("[micro_ai] is missing required side= key") end