AIs: idle_ai is not a "Dev AI", fixes #1955

As indicated in the comment of the idle_ai config file, an AI needs to
contain at least one stage, otherwise the default AI will be injected
under certain circumstances. Unlike indicated in the comment, this now
also applies to loading a mid-scenario save. (I will add that to the
comment in the next commit.)

As this AI was in data/ai/dev/, it was previously only loaded when
Wesnoth was started in debug mode. The config was thus not available
when playing in no-debug mode, causing the default AI to be injected on
reload. This caused issue #1955.

While not strictly necessary, we keep a redirect in data/ai/dev for
backward compatibility, in case the file is included in add-ons.
This commit is contained in:
mattsc 2017-10-04 16:45:04 -07:00
parent 9118330a30
commit cfb2aa8050
4 changed files with 14 additions and 12 deletions

10
data/ai/ais/idle_ai.cfg Normal file
View file

@ -0,0 +1,10 @@
#textdomain wesnoth-ai
[ai]
id=idle_ai
description=_"Multiplayer_AI^Dev AI: Idle AI" # wmllint: no spellcheck
# Needs to define at least one stage; otherwise, the default AI will be injected
# when used with [modify_side]switch_ai
[stage]
name=empty
[/stage]
[/ai]

View file

@ -1,2 +1,2 @@
# wmllint: no translatables
{ai/dev/idle_ai.cfg}
{ai/ais/idle_ai.cfg}

View file

@ -1,10 +1,2 @@
#textdomain wesnoth-ai
[ai]
id=idle_ai
description=_"Multiplayer_AI^Dev AI: Idle AI" # wmllint: no spellcheck
# Needs to define at least one stage; otherwise, the default AI will be injected
# when used with [modify_side]switch_ai
[stage]
name=empty
[/stage]
[/ai]
# wmllint: no translatables
{ai/ais/idle_ai.cfg}

View file

@ -44,7 +44,7 @@
[/set_variable]
[set_variable]
name=test_path_to_idle_ai
value=ai/dev/idle_ai.cfg
value=ai/ais/idle_ai.cfg
[/set_variable]
[set_variable]
name=test_path_to_formula_ai