Fix types passed to ride_type_has_flag

This commit is contained in:
Michał Janiszewski 2019-02-09 22:55:22 +01:00
parent 70ef8151fc
commit 379fd42dc4
3 changed files with 7 additions and 7 deletions

View file

@ -59,21 +59,21 @@ public:
if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL)
{
log_warning("Invalid game command for ride %u", _rideIndex);
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}
Ride* ride = get_ride(_rideIndex);
if (ride == nullptr || ride->type == RIDE_TYPE_NULL)
{
log_warning("Invalid game command, ride_id = %u", _rideIndex);
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}
rct_ride_entry* rideEntry = get_ride_entry(ride->subtype);
if (rideEntry == nullptr)
{
log_warning("Invalid game command for ride %u", _rideIndex);
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}
@ -88,14 +88,14 @@ public:
Ride* ride = get_ride(_rideIndex);
if (ride == nullptr || ride->type == RIDE_TYPE_NULL)
{
log_warning("Invalid game command, ride_id = %u", _rideIndex);
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}
rct_ride_entry* rideEntry = get_ride_entry(ride->subtype);
if (rideEntry == nullptr)
{
log_warning("Invalid game command for ride %u", _rideIndex);
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}

View file

@ -6389,7 +6389,7 @@ void game_command_callback_ride_remove_track_piece(
window_ride_construction_mouseup_demolish_next_piece(x, y, z, direction, type);
}
bool ride_type_has_flag(int32_t rideType, int32_t flag)
bool ride_type_has_flag(int32_t rideType, uint32_t flag)
{
return (RideProperties[rideType].flags & flag) != 0;
}

View file

@ -1109,7 +1109,7 @@ bool ride_has_log_reverser(Ride* ride);
bool ride_has_waterfall(Ride* ride);
bool ride_has_whirlpool(Ride* ride);
bool ride_type_has_flag(int32_t rideType, int32_t flag);
bool ride_type_has_flag(int32_t rideType, uint32_t flag);
bool ride_is_powered_launched(Ride* ride);
bool ride_is_block_sectioned(Ride* ride);
bool ride_has_any_track_elements(ride_id_t rideIndex);