OpenTTD / nml

NewGRF Meta Language
GNU General Public License v2.0
42 stars 36 forks source link

A named parameter cannot be used for a house ID #300

Open zephyris opened 1 year ago

zephyris commented 1 year ago

A named parameter cannot be used for a house ID, instead throwing a Unrecognised identifier for the parameter name, for example:

house_id_1=5;
item(FEAT_HOUSES, item_house_1, house_id_1) {
    ...
}

Gives Unrecognised identifier for house_id_1. This seems like a bug:

"in theory it's supposed to work (https://github.com/OpenTTD/nml/blob/master/nml/ast/item.py#L55 looks for named params via https://github.com/OpenTTD/nml/blob/master/nml/global_constants.py#L1415), so it looks like a bug (but a hard to fix one I think"

"I guess it's similar to https://github.com/OpenTTD/nml/issues/299 check happens at parsing but the registration of house_id_1 is during preprocess step"

glx22 commented 1 year ago

A possible solution/workaround could be #302