From da0368d1a3619fb2331c76c324e331cac6bbf447 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Sun, 5 Jul 2015 20:57:14 +0100 Subject: [PATCH] Fix bug in track remove. Fixes #1552 --- src/ride/track.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ride/track.c b/src/ride/track.c index 770f5d0b47..9ed5663adb 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -3999,8 +3999,8 @@ money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 originY, const rct_preview_track* trackBlock = get_track_def_from_ride(ride, type); trackBlock += mapElement->properties.track.sequence & 0xF; - - switch (mapElement->type & MAP_ELEMENT_DIRECTION_MASK){ + uint8 originDirection = mapElement->type & MAP_ELEMENT_DIRECTION_MASK; + switch (originDirection){ case 0: originX -= trackBlock->x; originY -= trackBlock->y; @@ -4027,7 +4027,7 @@ money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 originY, for (; trackBlock->index != 255; trackBlock++){ sint16 x = originX, y = originY, z = originZ; - switch (mapElement->type & MAP_ELEMENT_DIRECTION_MASK){ + switch (originDirection){ case 0: x += trackBlock->x; y += trackBlock->y;