|
13 | 13 | with NML; if not, write to the Free Software Foundation, Inc., |
14 | 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.""" |
15 | 15 |
|
16 | | -from nml import expression, generic, nmlop |
| 16 | +from nml import expression, generic, global_constants, nmlop |
17 | 17 | from nml.actions import action0, action1, action2, action2real, action2var, action6, actionD, real_sprite |
18 | 18 | from nml.ast import general, spriteblock |
19 | 19 |
|
@@ -292,6 +292,14 @@ def _validate_sprite(self, name, value): |
292 | 292 | else: |
293 | 293 | self.sprite_from_action1 = False |
294 | 294 | if isinstance(value, expression.ConstantNumeric): |
| 295 | + # For stations always assume a non-track tile ground, unless explicit rail ground sprite. |
| 296 | + if ( |
| 297 | + self.feature == 0x04 |
| 298 | + and self.type == Action2LayoutSpriteType.GROUND |
| 299 | + and value.value != global_constants.constant_numbers["GROUNDSPRITE_RAIL_X"] |
| 300 | + and value.value != global_constants.constant_numbers["GROUNDSPRITE_RAIL_Y"] |
| 301 | + ): |
| 302 | + self.create_register(name, expression.ConstantNumeric(0)) |
295 | 303 | generic.check_range(value.value, 0, (1 << 14) - 1, "sprite", value.pos) |
296 | 304 | return value |
297 | 305 | if value.supported_by_actionD(raise_error=False): |
|
0 commit comments