fix removing of fences for normal tracks

Building track and track designs did not use correct flag for ghosts therefore always attempting to remove fences and the removing of intersecting fences also did not work correctly. Fix both issues.
This commit is contained in:
IntelOrca 2016-04-02 23:51:12 +01:00
parent 4f59c752d6
commit d626d9d5f2
1 changed files with 9 additions and 10 deletions

View File

@ -4596,19 +4596,18 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
// push baseZ and clearanceZ
int cur_z = baseZ * 8;
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) {
if ((flags & GAME_COMMAND_FLAG_APPLY) && !(flags & GAME_COMMAND_FLAG_GHOST)) {
footpath_remove_litter(x, y, z);
// push bl bh??
if (rideTypeFlags & RIDE_TYPE_FLAG_18) {
map_remove_walls_at(x, y, baseZ * 8, clearanceZ * 8);
}
else {
uint8 _bl = *RCT2_GLOBAL(0x00F44054, uint8*);
_bl ^= 0x0F;
for (int dl = bitscanforward(_bl); dl != -1; dl = bitscanforward(_bl)){
_bl &= ~(1 << dl);
map_remove_intersecting_walls(x, y, baseZ, clearanceZ, direction & 3);
} else {
// Remove walls in the directions this track intersects
uint8 intersectingDirections = *RCT2_GLOBAL(0x00F44054, uint8*);
intersectingDirections ^= 0x0F;
for (int i = 0; i < 4; i++) {
if (intersectingDirections & (1 << i)) {
map_remove_intersecting_walls(x, y, baseZ, clearanceZ, i);
}
}
}
}