1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Fix lots of disgusting bugs

This commit is contained in:
lnz
2014-05-26 17:39:18 +02:00
parent 5e104477d3
commit ce270dbe19
2 changed files with 10 additions and 10 deletions

View File

@@ -335,16 +335,16 @@ void sub_68B089()
* Checks if the tile at coordinate at height counts as connected.
* @return 1 if connected, 0 otherwisei
*/
int map_coord_is_connected(uint16 coordinate, uint8 height, uint8 face_direction)
int map_coord_is_connected(uint16 tile_idx, uint8 height, uint8 face_direction)
{
rct_map_element* tile = RCT2_ADDRESS(RCT2_ADDRESS_TILE_MAP_ELEMENT_POINTERS, rct_map_element*)[coordinate];
rct_map_element* tile = RCT2_ADDRESS(RCT2_ADDRESS_TILE_MAP_ELEMENT_POINTERS, rct_map_element*)[tile_idx];
do {
rct_map_element_path_properties props = tile->properties.path;
uint8 path_type = props.type >> 2, path_dir = props.type & 3;
uint8 element_type = tile->type & MAP_ELEMENT_TYPE_MASK;
if (!(element_type & PATH_ROAD))
if (element_type != PATH_ROAD)
continue;
if (path_type & 1) {

View File

@@ -275,10 +275,10 @@ void ride_is_shop_reachable(rct_ride* ride, int ride_idx)
uint8 track_type = tile->properties.track.type;
ride = GET_RIDE(tile->properties.track.ride_index);
if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x80000) { // buggy but why
magic = RCT2_ADDRESS(0x0099BA64, uint8)[track_type * 16];
} else {
if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x80000) {
magic = RCT2_ADDRESS(0x0099CA64, uint8)[track_type * 16];
} else {
magic = RCT2_ADDRESS(0x0099BA64, uint8)[track_type * 16];
}
magic = magic << (tile->type & 3);
@@ -286,18 +286,19 @@ void ride_is_shop_reachable(rct_ride* ride, int ride_idx)
if (magic == 0)
return;
for (int count = 0; magic != 0; ++count) {
for (int count = 0; magic != 0; ++count) {
if (!(magic & 1)) {
magic >>= 1;
magic >>= 1;
continue;
}
magic >>= 1;
uint8 face_direction = count ^ 2;
y -= RCT2_ADDRESS(0x00993CCC, sint16)[face_direction * 2];
x -= RCT2_ADDRESS(0x00993CCE, sint16)[face_direction * 2];
tile_idx = ((x << 8) | y) >> 5;
if (map_coord_is_connected(tile, tile->base_height, face_direction))
if (map_coord_is_connected(tile_idx, tile->base_height, face_direction))
return;
}
@@ -328,7 +329,6 @@ void ride_check_all_reachable()
if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x20000) {
//blue
ride_is_shop_reachable(ride, i);
return;
}
else {
//pink