Schema: Fix declaring guard_x/y/loc as required keys in stationed_guard MicroAI (they are optional)

This commit is contained in:
Celtic Minstrel 2024-01-06 21:35:40 -05:00
parent 932dca3982
commit b9ff0c51fe
2 changed files with 17 additions and 1 deletions

View file

@ -148,7 +148,7 @@
{DEPRECATED_KEY id string}
{REQUIRED_KEY distance s_unsigned}
{REQUIRED_KEYS_LOC_OR_XY station string s_unsigned}
{REQUIRED_KEYS_LOC_OR_XY guard string s_unsigned}
{OPTIONAL_KEYS_LOC_OR_XY guard string s_unsigned}
{DEFAULT_KEY ca_score s_unsigned 300000}
[/case]
[case]

View file

@ -55,6 +55,22 @@
[/if]
#enddef
#define OPTIONAL_KEYS_LOC_OR_XY KEY_BASE TYPE_LOC TYPE_XY
[if]
glob_on_{KEY_BASE}_x=*
[or]
glob_on_{KEY_BASE}_y=*
[/or]
[then]
{REQUIRED_KEY {KEY_BASE}_x {TYPE_XY}}
{REQUIRED_KEY {KEY_BASE}_y {TYPE_XY}}
[/then]
[else]
{SIMPLE_KEY {KEY_BASE}_loc {TYPE_LOC}}
[/else]
[/if]
#enddef
[tag]
name="$action_wml"
max=0