Commit graph

125 commits

Author SHA1 Message Date
Iris Morelle
bee64fc78b Check unit/second_unit existence in FORCE_CHANCE_TO_HIT
Fixes an issue where the auxiliary event handlers for 'attack end' in
this macro might break if the affected unit or units are removed from
the map by a pre-existing 'attack end' event handler.

Unfortunately this still results in log warnings about failing to
auto-store unit/second_unit, but it's better than breaking WML execution
entirely.

    20190313 23:36:48 error engine: failed to auto-store $second_unit at (9,40)

The alternative I contemplated was to force unit/second_unit to be valid
in the event handlers by using empty filters, but then that would result
in the event handler being triggered *later* by another valid unit. This
is especially problematic since the event handler handles special
knowledge about the unit's WML ([specials][original_chance_to_hit]).
That option would not produce any spurious error messages but would
definitely cause new problems, especially when interacting with other
FCTH substitutions in the same scenario.

Ultimately FCTH's design is a bit questionable and relies too much on
state that may be broken by an external agent intentionally or otherwise
and produce unusual results.

Closes #3982.

[ci skip]
2019-03-13 23:49:34 -03:00
Severin Glöckner
5675918963 core macros: don't clear nonexistant variable
A leftover from the switch from {FOREACH} to [foreach]

[ci skip]
2018-09-10 00:02:18 +02:00
Charles Dang
0d0bb91d99 Added a CREDITS_SEPARATOR macro
[ci skip]

This way, UMC can use the default credit's separator in their credits sections.
2018-03-04 02:16:53 +11:00
sigurdfdragon
81ea433117 Macros: Fix typo 2017-10-12 20:26:33 -04:00
ln-zookeeper
8bbe4189ed Reverted FOREACH, NEXT and REPEAT to their original forms
This is because the changes (9fb175c9d6) possibly break some existing uses for no reason.
2017-03-22 19:45:21 +02:00
fendrin
8a9feb10ac Fix several bugs introduced with the FOREACH replacement. 2016-08-06 21:17:01 +02:00
fendrin
8544320b58 Replace FOREACH 2016-08-06 06:20:41 +02:00
Charles Dang
491fa91906 Deprecated FOREACH and NEXT
These feature unbalanced WML and have been replaced by proper tags.
2016-08-06 11:08:48 +11:00
gfgtdf
ab1a4629a9 rename [filter] -> [filter_location] in [random_placement] 2015-12-10 01:43:32 +01:00
gfgtdf
f329b1e431 fixup random_placement patch 2015-12-08 01:13:14 +01:00
gfgtdf
a9f141c58e fixup SCATTER_UNITS
was broken in 9d656ad755
2015-12-07 22:40:26 +01:00
gfgtdf
dc786dc181 add tag [random_placement]
and use it to implement SCATTER_IMAGE,SCATTER_EMBELLISHMENTS and
SCATTER_UNITS
2015-12-07 21:49:09 +01:00
Charles Dang
2775d3df4d Minor simplification of FORCE_CHANCE_TO_HIT 2015-10-04 13:52:23 +11:00
Celtic Minstrel
9fb175c9d6 Use new looping tags to implement loop macros 2015-10-01 13:37:55 -04:00
Charles Dang
dd0b2104a5 Deprecated MENU_IMG_TXT and MENU_IMG_TXT2 2015-10-01 21:10:27 +11:00
Ignacio R. Morelle
b9c6ab59d6 Fix WML variable leak in RECRUIT_UNIT_VARIATIONS 2015-08-09 01:52:27 -03:00
Bär Halberkamp
ae0a2fe2cc Removed [full_heal] 2015-04-03 19:34:16 +02:00
Charles Dang
72e67eee93 Used include_borders=no in SCATTER_UNITS
This is the 'more straightforward' method of doing this mentioned in 982d868b94
2015-01-15 07:47:24 +11:00
Charles Dang
6f60640c8e Revert "Use [modify_unit] for MODIFY_UNIT"
This reverts commit 02ecc00b76.
2015-01-07 00:26:24 +11:00
Charles Dang
02ecc00b76 Use [modify_unit] for MODIFY_UNIT 2015-01-06 23:53:10 +11:00
Bär Halberkamp
db028708c4 Added a lua implementation for FULL_HEAL and PUT_TO_RECALL_LIST 2014-10-21 19:41:36 +02:00
ln-zookeeper
982d868b94 Fix SCATTER_UNITS placing units on map borders 2014-07-05 14:04:41 +03:00
ln-zookeeper
9312420c08 Fix RECRUIT_UNIT_VARIATIONS not ensuring full hp 2014-05-14 00:15:22 +03:00
Elvish_Hunter
993861aff4 Pushed LOOT macro from LoW, TRoW and THoT in core, file utils.cfg.
wmlindent also reindented other two macro files
2012-04-22 09:12:48 +00:00
Steven Panek
7cb034c05f Fixed some typos. 2012-02-15 18:29:12 +00:00
Steven Panek
bbcc185631 Fixed ATTACK_DEPTH4. 2011-10-10 12:27:33 +00:00
Steven Panek
695269c34a Added comments to the four-difficulty macros...
...so they'll get into the macro reference page.
2011-09-12 08:44:26 +00:00
Steven Panek
4fedbcece5 Moved the four-difficulty macros to core; wrote some new ones. 2011-09-12 08:28:15 +00:00
Anonymissimus
af4a01db8c Mute some warning messages in {FORCE_CHANCE_TO_HIT }. 2011-03-13 21:46:43 +00:00
Steven Panek
03a3d3b552 Converted remaining instances of 'add -'. 2010-12-05 23:45:04 +00:00
Steven Panek
0a6fd74f77 Removed the comments in ON_DIFFICULTY's EASY definition,
...for it breaks things...

Fixes bug #17025.

shadowmaster demanded this commit.
2010-11-06 04:01:53 +00:00
Lari Nieminen
b6e15aaaf3 Added a new macro file debug-utils.cfg...
...and moved some debugging macros there.
2010-10-21 08:09:27 +00:00
Eric S. Raymond
e7d337a676 Reindent mainline. 2010-09-23 13:04:56 +00:00
Eric S. Raymond
28a730d1af More wmllint/wmlscope cleanup. 2010-09-12 21:38:15 +00:00
Fabian Müller
b3e5e95db3 Macro for doing conditional operations on variables. 2010-08-31 15:50:49 +00:00
Fabian Müller
95ecd0c701 LoW: Enabled the second and third chapter of the multiplayer campaign port. 2010-08-30 22:00:01 +00:00
Eric S. Raymond
9ec6db37dd Add a needed wmlsope directive. 2010-08-30 14:04:58 +00:00
Lari Nieminen
5eb9231fd7 Fixed a broken loop in the PUT_TO_RECALL_LIST macro. 2010-08-25 13:50:10 +00:00
Lari Nieminen
ccb35966ec Converted the MOVE_UNIT macro to use the new [move_unit] tag. 2010-08-23 07:44:42 +00:00
Lari Nieminen
5370f418b2 Removed the now unneeded NEUTRAL_SIDE macro. 2010-08-10 08:47:09 +00:00
Lari Nieminen
9a60f695e5 Renamed some variables used in macros...
...and made sure that some currently uncleared variables get cleared properly.
2010-08-10 08:43:33 +00:00
Steven Panek
41c78d8c16 Even more 'format' -> 'value' conversions;...
...this should hopefully take care of all of them.
2010-05-12 00:54:56 +00:00
Steven Panek
9ef27042d4 Removed an excessive newline between QUANTIFY and ON_DIFFICULTY 2010-03-27 18:33:04 +00:00
Steven Panek
f519e977ba New macro, ON_DIFFICULTY. 2010-03-27 18:30:53 +00:00
Eric S. Raymond
c4374f87e3 More macro argument type checking. No mismarches in mainline. 2010-02-15 21:46:31 +00:00
Eric S. Raymond
380c8e86e7 More macro argument type checking. No mismatches in mainline. 2010-02-15 14:32:20 +00:00
Eric S. Raymond
75f2727548 More nacro argument type checking. No mismatches in mainline. 2010-02-11 22:45:04 +00:00
Eric S. Raymond
d72fb9cca7 More impprovements in macro type checking. No conflicts in mainline. 2010-02-11 20:26:35 +00:00
Alexander van Gessel
cd60786ee9 Revert "Deprecate the NEUTRAL_SIDE macro",
...add a note about how the alternative for NEUTRAL_SIDE.

This reverts commit 2010-01-26T19:08:37Z!ai0867@gmail.com.
2010-01-27 01:28:29 +01:00
Alexander van Gessel
bd8bdca90e Deprecate the NEURTRAL_SIDE macro 2010-01-26 20:08:37 +01:00