-
Notifications
You must be signed in to change notification settings - Fork 38
Add: necessary properties in action0 in order to support bridges over station feature from OpenTTD 15.0-beta3 #385
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
Conversation
|
No love for road stops and blocked pillar flags for both? |
|
I do not need road stops and do not have source code of NewGRF that could provide them. |
|
It's exactly the same as for rail stations, just a different property number (0x13 for minimum height) |
|
There's simpler solution than duplicating flag function, which most likely won't work. Edit: I may be wrong (didn't check the spec yet) |
b6c9d49 to
b2c3f95
Compare
|
Don't think a class is the way to go - how about a function generator? (also, classes aren't named like that) |
b2c3f95 to
f6fb09a
Compare
05ef859 to
e9381a2
Compare
nml/actions/action0properties.py
Outdated
| if isinstance(value, ConstantNumeric): | ||
| value = Array([value, invert_function(value)] * prefered_size, value.pos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good idea to me.
All tiles having the same pillar placement limitation is probably quite rare.
And always defining 20 tile types feels wasteful.
| def invert_bridge_pillars_flags(value): | ||
| out = ConstantNumeric(0, value.pos) | ||
| for i_flag, o_flag in [ | ||
| (global_constant_numbers["BRIDGE_PILLAR_CORNER_W"], global_constant_numbers["BRIDGE_PILLAR_CORNER_S"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_CORNER_S"], global_constant_numbers["BRIDGE_PILLAR_CORNER_W"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_CORNER_N"], global_constant_numbers["BRIDGE_PILLAR_CORNER_E"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_CORNER_E"], global_constant_numbers["BRIDGE_PILLAR_CORNER_N"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_EDGE_NE"], global_constant_numbers["BRIDGE_PILLAR_EDGE_NE"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_EDGE_SE"], global_constant_numbers["BRIDGE_PILLAR_EDGE_SW"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_EDGE_SW"], global_constant_numbers["BRIDGE_PILLAR_EDGE_SE"]), | ||
| (global_constant_numbers["BRIDGE_PILLAR_EDGE_NW"], global_constant_numbers["BRIDGE_PILLAR_EDGE_NW"]), | ||
| ]: | ||
| if value.value & (1 << i_flag): | ||
| out.value += 1 << o_flag | ||
| return out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should not be here, it's a bad idea to assume that the flags can be flipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because NML shouldn't be assuming anything. There's no rule that says sprites should be "inverted".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here picture clearly says that other values are invertible.

e9381a2 to
f02ccc8
Compare
Allows to use bridges over stations feature.
56caed4 to
cb611e3
Compare
…lars_flags so invert feature can be used for all tiles
cb611e3 to
b45e186
Compare
|
superseded by #388 |

Allows to use bridges over stations feature for rail stations.
Do not contain necessary additions to allow same feature for road stops and other station types.
Remains compatible with OpenTTD 14.0 and older.