Check access to duck_move_offset

This commit is contained in:
Michał Janiszewski 2016-09-18 20:00:38 +02:00
parent 8ffe9cdcf6
commit 453e508716
2 changed files with 3 additions and 2 deletions

View File

@ -6997,7 +6997,7 @@ static void sub_6DB807(rct_vehicle *vehicle)
sprite_move(x, y, z, (rct_sprite*)vehicle);
}
extern const rct_xy16 duck_move_offset[];
extern const rct_xy16 duck_move_offset[4];
/**
* Collision Detection
@ -7101,6 +7101,7 @@ static bool vehicle_update_motion_collision_detection(
if (direction < 0x14) continue;
assert(((4 + vehicle->sprite_direction) >> 3) < countof(duck_move_offset));
uint32 next_x_diff = abs(x + duck_move_offset[(4 + vehicle->sprite_direction) >> 3].x - collideVehicle->x);
uint32 next_y_diff = abs(y + duck_move_offset[(4 + vehicle->sprite_direction) >> 3].y - collideVehicle->y);

View File

@ -35,7 +35,7 @@ static void duck_update_double_drink(rct_duck *duck);
static void duck_update_fly_away(rct_duck *duck);
// rct2: 0x009A3B04
const rct_xy16 duck_move_offset[] = {
const rct_xy16 duck_move_offset[4] = {
{ -1, 0 },
{ 0, 1 },
{ 1, 0 },