Possible bug in one of the base macros

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Possible bug in one of the base macros

Post by Velensk »

I was using the scatter units macro to place some enemy units on the board and I noticed that one less of them appeared than was intended, however the enemy side that controls it always starts their first turn by recruiting one of that unit type despite not being able to recruit it.

What I think is somehow happening is that the range that the units could randomly spawn in includes the recall list and that it is recalling it onto the field.

I'm fairly sure this isn't intended but I thought I'd bring it up here before I report it just incase it is.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Possible bug in one of the base macros

Post by Anonymissimus »

Sure that's a bug. A possible cause is that afaik SLFs include the map border, resulting in an attempt to do [unit] for invalid coordinates which places the unit on the recall list instead.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Brilliand
Posts: 80
Joined: July 11th, 2009, 12:15 am

Re: Possible bug in one of the base macros

Post by Brilliand »

Anonymissimus wrote:Sure that's a bug. A possible cause is that afaik SLFs include the map border, resulting in an attempt to do [unit] for invalid coordinates which places the unit on the recall list instead.
If this is the problem, then specifying a range of tiles in the filter (even if it's the whole map) would be a viable workaround.
You are a Dark Adept: you dimmerse yourself in the dark arts...potentially with great rewards....
-JW's personality quiz
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Possible bug in one of the base macros

Post by zookeeper »

Yes, the cause is that the macro uses [store_locations] without filtering out border hexes... so unless the SLF in the macro call does so, the macro might attempt to place a unit on a border hex, at which point I presume it ends up on the recall list instead.

I've committed a fix to master, but because the code is a bit iffy, I wouldn't mind if it'd get a little bit more testing before I add it to 1.12 as well. To test, you can just replace the whole utils.cfg with this version.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Possible bug in one of the base macros

Post by zookeeper »

Committed to 1.12 as well now.
Post Reply