1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 01:35:06 +01:00

Merge pull request #3610 from zsilencer/bugfixes

Fix #3601: Assert in paint.c
Fix #3609: Crash from invalid peep
This commit is contained in:
Ted John
2016-05-15 13:38:40 +01:00
3 changed files with 10 additions and 12 deletions

View File

@@ -151,12 +151,11 @@ paint_struct * sub_98196C(
uint32 image_id,
sint8 x_offset, sint8 y_offset,
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
uint16 z_offset,
sint16 z_offset,
uint32 rotation
) {
assert((uint16) bound_box_length_x == (sint16) bound_box_length_x);
assert((uint16) bound_box_length_y == (sint16) bound_box_length_y);
assert((uint16) z_offset == (sint16) z_offset);
RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0;
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
@@ -323,7 +322,7 @@ paint_struct * sub_98197C(
uint32 image_id,
sint8 x_offset, sint8 y_offset,
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
uint16 z_offset,
sint16 z_offset,
sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z,
uint32 rotation
) {
@@ -407,13 +406,12 @@ paint_struct * sub_98198C(
uint32 image_id,
sint8 x_offset, sint8 y_offset,
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
uint16 z_offset,
sint16 z_offset,
sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z,
uint32 rotation
) {
assert((uint16) bound_box_length_x == (sint16) bound_box_length_x);
assert((uint16) bound_box_length_y == (sint16) bound_box_length_y);
assert((uint16) z_offset == (sint16) z_offset);
RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0;
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
@@ -453,13 +451,12 @@ paint_struct * sub_98199C(
uint32 image_id,
sint8 x_offset, sint8 y_offset,
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
uint16 z_offset,
sint16 z_offset,
sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z,
uint32 rotation
) {
assert((uint16) bound_box_length_x == (sint16) bound_box_length_x);
assert((uint16) bound_box_length_y == (sint16) bound_box_length_y);
assert((uint16) z_offset == (sint16) z_offset);
if (RCT2_GLOBAL(0xF1AD28, uint32) == 0) {
return sub_98197C(

View File

@@ -87,10 +87,10 @@ enum PAINT_STRUCT_FLAGS {
void painter_setup();
paint_struct * sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, uint32 rotation);
paint_struct * sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
paint_struct * sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
paint_struct * sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
paint_struct * sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, uint32 rotation);
paint_struct * sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
paint_struct * sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
paint_struct * sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y);
bool paint_attach_to_previous_ps(uint32 image_id, uint16 x, uint16 y);

View File

@@ -1578,7 +1578,8 @@ void remove_peep_from_queue(rct_peep* peep)
return;
}
for (rct_peep* other_peep = GET_PEEP(ride->last_peep_in_queue[cur_station]);;
for (rct_peep* other_peep = GET_PEEP(ride->last_peep_in_queue[cur_station]);
ride->last_peep_in_queue[cur_station] != 0xFFFF;
other_peep = GET_PEEP(other_peep->next_in_queue)){
if (peep->sprite_index == other_peep->next_in_queue){
other_peep->next_in_queue = peep->next_in_queue;