diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index eb6f6b87da..a98baee3d2 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -164,10 +164,10 @@ void KeyboardShortcuts::GetKeyboardMapScroll(const uint8 * keysState, sint32 * x { uint16 shortcutKey = _keys[shortcutId]; uint8 scancode = shortcutKey & 0xFF; - + if (shortcutKey == 0xFFFF) continue; if (!keysState[scancode]) continue; - + if (shortcutKey & SHIFT) { if (!keysState[SDL_SCANCODE_LSHIFT] && !keysState[SDL_SCANCODE_RSHIFT]) continue; } diff --git a/src/openrct2/game.c b/src/openrct2/game.c index 645e706ea0..d7e80aecb1 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -573,7 +573,7 @@ sint32 game_do_command_p(sint32 command, sint32 *eax, sint32 *ebx, sint32 *ecx, // Do the callback (required for multiplayer to work correctly), but only for top level commands if (gGameCommandNestLevel == 1) { - if (game_command_callback && !(flags & GAME_COMMAND_FLAG_GHOST)) + if (game_command_callback && !(flags & GAME_COMMAND_FLAG_GHOST)) { game_command_callback(*eax, *ebx, *ecx, *edx, *esi, *edi, *ebp); game_command_callback = 0; diff --git a/src/openrct2/management/research.c b/src/openrct2/management/research.c index 8eb0413fcf..1242844954 100644 --- a/src/openrct2/management/research.c +++ b/src/openrct2/management/research.c @@ -196,13 +196,13 @@ void research_finish_item(sint32 entryIndex) if (gConfigInterface.select_by_track_type && track_type_has_ride_groups(base_ride_type)) { const ride_group * rideGroup = get_ride_group(base_ride_type, rideEntry); - + if (ride_group_is_invented(rideGroup)) { ride_group_was_invented_before = true; } } - + ride_type_set_invented(base_ride_type); openrct2_assert(base_ride_type < countof(RideTypePossibleTrackConfigurations), "Invalid base_ride_type = %d", base_ride_type); diff --git a/src/openrct2/network/network.cpp b/src/openrct2/network/network.cpp index 1e9747e0a5..f2fccb41d9 100644 --- a/src/openrct2/network/network.cpp +++ b/src/openrct2/network/network.cpp @@ -626,7 +626,7 @@ bool Network::CheckSRAND(uint32 tick, uint32 srand0) return true; } - if (tick == server_srand0_tick) + if (tick == server_srand0_tick) { server_srand0_tick = 0; // Check that the server and client sprite hashes match diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 925d2f7072..70ed2dd7a3 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -410,14 +410,14 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem * item) const uint8 rideGroupIndex = 0; const ride_group * rideGroup = get_ride_group(rideTypeIdx, (rct_ride_entry *)&_legacyType); - + // If the ride group is NULL, the track type does not have ride groups. if (rideGroup != NULL) { for (uint8 i = rideGroupIndex + 1; i < MAX_RIDE_GROUPS_PER_RIDE_TYPE; i++) { ride_group * irg = ride_group_find(rideTypeIdx, i); - + if (irg != NULL) { if (ride_groups_are_equal(irg, rideGroup)) @@ -428,7 +428,7 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem * item) const } } } - + item->RideGroupIndex = rideGroupIndex; } diff --git a/src/openrct2/peep/peep.c b/src/openrct2/peep/peep.c index ffe5d75345..c8605d9ced 100644 --- a/src/openrct2/peep/peep.c +++ b/src/openrct2/peep/peep.c @@ -174,10 +174,10 @@ static void peep_update_ride_inspected(sint32 rideIndex); bool loc_690FD0(rct_peep *peep, uint8 *rideToView, uint8 *rideSeatToView, rct_map_element *esi); -#ifdef DEBUG_DESYNC +#ifdef DEBUG_DESYNC #define peep_rand() scenario_rand_data(peep) -#else -#define peep_rand() scenario_rand() +#else +#define peep_rand() scenario_rand() #endif const char *gPeepEasterEggNames[] = { diff --git a/src/openrct2/ride/ride.c b/src/openrct2/ride/ride.c index 33ed714301..118c3fbc07 100644 --- a/src/openrct2/ride/ride.c +++ b/src/openrct2/ride/ride.c @@ -5948,13 +5948,13 @@ static money32 ride_create(sint32 type, sint32 subType, sint32 flags, sint32 *ou uint8 *availableRideEntries = get_ride_entry_indices_for_ride_type(type); for (uint8 *rei = availableRideEntries; *rei != 255; rei++) { rideEntry = get_ride_entry(*rei); - + // Can happen in select-by-track-type mode if (!ride_entry_is_invented(*rei)) { continue; } - + if (!(rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) || rideTypeShouldLoseSeparateFlag(rideEntry)) { subType = *rei; goto foundRideEntry; diff --git a/src/openrct2/ride/track_design.c b/src/openrct2/ride/track_design.c index 6f5bfe9212..b2d39a90d1 100644 --- a/src/openrct2/ride/track_design.c +++ b/src/openrct2/ride/track_design.c @@ -1432,7 +1432,7 @@ static money32 place_track_design(sint16 x, sint16 y, sint16 z, uint8 flags, uin { entryIndex = 0xFF; } - + // The rest of the cases are handled by the code in ride_create() if (track_type_has_ride_groups(td6->type) && entryIndex == 0xFF) { @@ -1442,12 +1442,12 @@ static money32 place_track_design(sint16 x, sint16 y, sint16 z, uint8 flags, uin uint8 rideGroupIndex = ori->RideGroupIndex; ride_group * td6RideGroup = ride_group_find(td6->type, rideGroupIndex); rct_ride_entry * ire; - + uint8 *availableRideEntries = get_ride_entry_indices_for_ride_type(td6->type); for (uint8 *rei = availableRideEntries; *rei != 255; rei++) { ire = get_ride_entry(*rei); - + if (!ride_entry_is_invented(*rei)) { continue; diff --git a/src/openrct2/scenario/scenario.c b/src/openrct2/scenario/scenario.c index 05629e98de..88e5f49fb2 100644 --- a/src/openrct2/scenario/scenario.c +++ b/src/openrct2/scenario/scenario.c @@ -566,7 +566,7 @@ static sint32 scenario_create_ducks() * * @return eax */ -#ifndef DEBUG_DESYNC +#ifndef DEBUG_DESYNC uint32 scenario_rand() #else static FILE *fp = NULL; @@ -613,7 +613,7 @@ uint32 dbg_scenario_rand(const char *file, const char *function, const uint32 li return gScenarioSrand1; } -#ifdef DEBUG_DESYNC +#ifdef DEBUG_DESYNC void dbg_report_desync(uint32 tick, uint32 srand0, uint32 server_srand0, const char *clientHash, const char *serverHash) { if (fp == NULL) @@ -633,9 +633,9 @@ void dbg_report_desync(uint32 tick, uint32 srand0, uint32 server_srand0, const c { const bool sprites_mismatch = serverHash[0] != '\0' && strcmp(clientHash, serverHash); - fprintf(fp, "[%s] !! DESYNC !! Tick: %d, Client Hash: %s, Server Hash: %s, Client Rand: %08X, Server Rand: %08X - %s\n", realm, - tick, - clientHash, + fprintf(fp, "[%s] !! DESYNC !! Tick: %d, Client Hash: %s, Server Hash: %s, Client Rand: %08X, Server Rand: %08X - %s\n", realm, + tick, + clientHash, ( (serverHash[0] != '\0') ? serverHash : "" ), srand0, server_srand0, diff --git a/src/openrct2/scenario/scenario.h b/src/openrct2/scenario/scenario.h index 79c9fac0d4..05939d1dae 100644 --- a/src/openrct2/scenario/scenario.h +++ b/src/openrct2/scenario/scenario.h @@ -394,12 +394,12 @@ sint32 scenario_load_and_play_from_path(const char *path); void scenario_begin(); void scenario_update(); -#ifdef DEBUG_DESYNC +#ifdef DEBUG_DESYNC uint32 dbg_scenario_rand(const char *file, const char *function, const uint32 line, const void *data); #define scenario_rand() dbg_scenario_rand(__FILE__, __FUNCTION__, __LINE__, NULL) #define scenario_rand_data(data) dbg_scenario_rand(__FILE__, __FUNCTION__, __LINE__, data) void dbg_report_desync(uint32 tick, uint32 srand0, uint32 server_srand0, const char *clientHash, const char *serverHash); -#else +#else uint32 scenario_rand(); #endif diff --git a/src/openrct2/windows/new_ride.c b/src/openrct2/windows/new_ride.c index 566e103434..0e746e5650 100644 --- a/src/openrct2/windows/new_ride.c +++ b/src/openrct2/windows/new_ride.c @@ -364,7 +364,7 @@ static ride_list_item * window_new_ride_iterate_over_ride_group(uint8 rideType, { const ride_group * rideEntryRideGroup = get_ride_group(rideType, rideEntry); const ride_group * rideGroup = ride_group_find(rideType, rideGroupIndex); - + if (!ride_groups_are_equal(rideEntryRideGroup, rideGroup)) continue; } diff --git a/src/openrct2/windows/ride.c b/src/openrct2/windows/ride.c index e3381b08b8..d175ac419c 100644 --- a/src/openrct2/windows/ride.c +++ b/src/openrct2/windows/ride.c @@ -2680,11 +2680,11 @@ static void window_ride_vehicle_mousedown(rct_widgetindex widgetIndex, rct_windo { rideGroup = get_ride_group(ride->type, rideEntry); currentRideGroup = get_ride_group(ride->type, currentRideEntry); - + if (!ride_groups_are_equal(rideGroup, currentRideGroup)) continue; } - + if (ride->subtype == rideEntryIndex) selectedIndex = numItems;