mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 08:14:38 +01:00
Add some bounds checks
This commit is contained in:
committed by
Michał Janiszewski
parent
8e55c811f6
commit
4732afa315
@@ -669,8 +669,9 @@ void research_insert_scenery_group_entry(uint8 entryIndex, bool researched)
|
||||
research_insert(researched, entryIndex, RESEARCH_CATEGORY_SCENERY_GROUP);
|
||||
}
|
||||
|
||||
bool ride_type_is_invented(sint32 rideType)
|
||||
bool ride_type_is_invented(uint32 rideType)
|
||||
{
|
||||
Guard::Assert(rideType < Util::CountOf(_researchedRideTypes), GUARD_LINE);
|
||||
return _researchedRideTypes[rideType];
|
||||
}
|
||||
|
||||
@@ -684,8 +685,9 @@ bool track_piece_is_available_for_ride_type(uint8 rideType, sint32 trackType)
|
||||
return RideTypePossibleTrackConfigurations[rideType] & (1ULL << trackType);
|
||||
}
|
||||
|
||||
void ride_type_set_invented(sint32 rideType)
|
||||
void ride_type_set_invented(uint32 rideType)
|
||||
{
|
||||
Guard::Assert(rideType < Util::CountOf(_researchedRideTypes), GUARD_LINE);
|
||||
_researchedRideTypes[rideType] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,11 +125,11 @@ void research_remove(rct_research_item * researchItem);
|
||||
void research_insert_ride_entry(uint8 entryIndex, bool researched);
|
||||
void research_insert_scenery_group_entry(uint8 entryIndex, bool researched);
|
||||
|
||||
void ride_type_set_invented(sint32 rideType);
|
||||
void ride_type_set_invented(uint32 rideType);
|
||||
void ride_entry_set_invented(sint32 rideEntryIndex);
|
||||
void scenery_set_invented(uint16 sceneryItem);
|
||||
void scenery_set_not_invented(uint16 sceneryItem);
|
||||
bool ride_type_is_invented(sint32 rideType);
|
||||
bool ride_type_is_invented(uint32 rideType);
|
||||
bool ride_entry_is_invented(sint32 rideEntryIndex);
|
||||
bool track_piece_is_available_for_ride_type(uint8 rideType, sint32 trackType);
|
||||
bool scenery_group_is_invented(sint32 sgIndex);
|
||||
|
||||
@@ -3622,6 +3622,7 @@ static void peep_update_ride_prepare_for_state_9(rct_peep * peep)
|
||||
{
|
||||
Ride * ride = get_ride(peep->current_ride);
|
||||
|
||||
Guard::Assert(peep->current_ride_station < Util::CountOf(ride->exits), GUARD_LINE);
|
||||
sint16 x = ride->exits[peep->current_ride_station].x;
|
||||
sint16 y = ride->exits[peep->current_ride_station].y;
|
||||
sint16 z = ride->station_heights[peep->current_ride_station];
|
||||
|
||||
Reference in New Issue
Block a user