Skip to content

Commit

Permalink
Avoid [+campaign] use
Browse files Browse the repository at this point in the history
  • Loading branch information
soliton- committed Jan 15, 2021
1 parent 8f84425 commit f29ff05
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions data/campaigns/Dead_Water/_main.cfg
Expand Up @@ -20,6 +20,8 @@
{CAMPAIGN_DIFFICULTY HARD "units/merfolk/warrior.png~RC(magenta>red)" ( _ "Warrior") ( _ "Challenging")}
{CAMPAIGN_DIFFICULTY NIGHTMARE "units/merfolk/triton.png~RC(magenta>red)" ( _ "Triton") ( _ "Difficult")}

{ENABLE_KRAKEN}

description= _ "You are Kai Krellis, son and heir of the last merman king but only a child. A necromancer is turning your subjects into undead slaves! Lead your people on a mission to convince a powerful mer-sorceress to help you repel the invasion. The oceans near the Northern Lands are perilous, so you will need cunning and bravery to survive. But first you need to gain the respect of your troops!
" + _ "(Intermediate level, 10 scenarios.)"
Expand Down Expand Up @@ -71,13 +73,6 @@
{campaigns/Dead_Water/units}
[/units]

# wmllint bug: wmllint is not smart enough to realise that the campaign already has an id
# wmllint: validate-off
[+campaign]
{ENABLE_KRAKEN}

This comment has been minimized.

Copy link
@hexagonrecursion

hexagonrecursion Jan 16, 2021

Contributor

Are you sure this will not cause errors? {ENABLE_KRAKEN} was inside of an #ifdef CAMPAIGN_DEAD_WATER because Kraken is a campaign-specific unit.

#define ENABLE_KRAKEN
[modify_unit_type]
type="Cuttle Fish"
add_advancement="Kraken"
set_experience=80
[/modify_unit_type]
#enddef
[unit_type]
id=Kraken

This comment has been minimized.

Copy link
@soliton-

soliton- Jan 16, 2021

Author Member

The modification is only active in the campaign. You can also check other campaigns that enable advancements like SoF for example.

This comment has been minimized.

Copy link
@hexagonrecursion

hexagonrecursion Jan 16, 2021

Contributor

SoF is different. It uses

{ENABLE_DWARVISH_RUNESMITH}

which is defined here
#define ENABLE_DWARVISH_RUNESMITH

{ENABLE_KRAKEN} on the other hand is a campaign-specific macro

data/campaigns/Dead_Water/_main.cfg is parsed in two contexts:

  1. one where CAMPAIGN_DEAD_WATER is not defined (e.g. to retrieve the list of all campaigns)
  2. one where CAMPAIGN_DEAD_WATER is defined

In the first context data/campaigns/Dead_Water/units/Kraken.cfg is never included which means the macro ENABLE_KRAKEN is never defined.

Additionally the line


precedes the line
{campaigns/Dead_Water/utils}

which means that even in the second context the macro is used before it is defined

This comment has been minimized.

Copy link
@soliton-

soliton- Jan 16, 2021

Author Member

Yeah, my mistake. I thought there was any point to the macro and it was with the other optional advancements. Didn't check closely enough. Instead there is no point to the macro at all.

[/campaign]
# wmllint: validate-on

{campaigns/Dead_Water/scenarios}

[lua]
Expand Down

0 comments on commit f29ff05

Please sign in to comment.