Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line --preprocess misses data/core/units.cfg (LESS_NIMBLE_ELF, etc) #4152

Closed
stevecotton opened this issue Jul 5, 2019 · 4 comments

Comments

Projects
None yet
5 participants
@stevecotton
Copy link
Contributor

commented Jul 5, 2019

The logic in wesnoth.cpp's handle_preprocess_command assumes that all of the core WML #defines will be in data/core/macros or data/core/terrain-graphics. The assumption isn't quite true, which means it fails to process add-ons that use {LESS_NIMBLE_ELF} (a common define for elvish fighter units).

Of the files that aren't included, only data/core/units.cfg looks likely to be necessary.

data/core/hotkeys.cfg:#define IF_APPLE_CMD_ELSE_CTRL
data/core/units.cfg:#define LESS_NIMBLE_ELF
data/core/units.cfg:#define RACIAL_NOTES_ORCS_AND_GOBLINS
data/core/units.cfg:#define WOODLAND_RESISTANCE
data/core/units.cfg:#define FLY_MOVE
data/core/units.cfg:#define FLY_DEFENSE DEFENSE_NUMBER
data/core/units.cfg:#define FLY_RESISTANCE
data/core/units.cfg:#define MOUNTAIN_MOVE
data/core/units.cfg:#define MOUNTAIN_DEFENSE
data/core/units.cfg:#define DRAKEFLY_MOVE
data/core/units.cfg:#define DRAKEFLY_RESISTANCE
data/core/units/humans/Mage_Elder.cfg:#define ELDER_MAGE_LIGHTNING DIRECTION_NUMBER
data/core/units/undead/Corpse_Soulless.cfg:#define UNIT_BODY_SOULLESS_STATS MOVETYPE_ID MOVES_NUMBER HP_AMOUNT
data/core/units/undead/Corpse_Soulless.cfg:#define UNIT_BODY_SOULLESS_GRAPHICS BASE_NAME
data/core/units/undead/Corpse_Walking.cfg:#define UNIT_BODY_WALKING_CORPSE_STATS MOVTYPE_NAME MOVES_NUMBER HP_AMOUNT
data/core/units/undead/Corpse_Walking.cfg:#define UNIT_BODY_WALKING_CORPSE_GRAPHICS BASE_NAME
@ProditorMagnus

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2019

I wonder if that is why I had to collect core macros in separate step https://github.com/ProditorMagnus/WML_tree_tools/blob/master/py_files/preprocess_addon.py#L45

@stevecotton

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2019

Including data/core/units.cfg would bring in all of the data/core/units/... subdirectories. So if we want to fix this, I think the solution would be to move the macros from data/core/units.cfg to a new data/core/macros/movetypes.cfg.

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

I was thinking that too - simply moving the macros seems easier than dragging in another directory. (And yeah the walking corpse / soulless stuff isn't necessary. It's the sort of thing you should #undef at the end of the file.)

Pentarctagon added a commit to Pentarctagon/wesnoth that referenced this issue Jul 12, 2019

Pentarctagon added a commit to Pentarctagon/wesnoth that referenced this issue Jul 12, 2019

Command line --preprocess missing some macros.
Command line --preprocess doesn't process macros in data/core/units.cfg.

Fixes wesnoth#4152.

Pentarctagon added a commit to Pentarctagon/wesnoth that referenced this issue Jul 14, 2019

Command line --preprocess missing some macros.
Command line --preprocess doesn't process macros in data/core/units.cfg.

Fixes wesnoth#4152.
@sevu

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

The WC and hotkeys macro have an #undef at the end of the file. If this is as well done for ELDER_MAGE_LIGHTNING (which includes the image of the unit, and is thus not reusable) and RACIAL_NOTES_ORCS_AND_GOBLINS then all macros are addressed.

Pentarctagon added a commit that referenced this issue Jul 17, 2019

Command line --preprocess missing some macros.
Command line --preprocess doesn't process macros in data/core/units.cfg.

Fixes #4152.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.