diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index f7bc0db324..b1fd6b1b34 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3574,7 +3574,7 @@ void Vehicle::UpdateCollisionSetup() for (int32_t i = 0; i < 10; i++) { - crashed_vehicle_particle_create(train->colours, train->x, train->y, train->z); + crashed_vehicle_particle_create(train->colours, { train->x, train->y, train->z }); } train->flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; @@ -5300,7 +5300,7 @@ void Vehicle::CrashOnLand() uint8_t numParticles = std::min(sprite_width, static_cast(7)); while (numParticles-- != 0) - crashed_vehicle_particle_create(colours, x, y, z); + crashed_vehicle_particle_create(colours, { x, y, z }); flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; animation_frame = 0; @@ -5364,7 +5364,7 @@ void Vehicle::CrashOnWater() crash_splash_create(x - 4, y + 8, z); for (int32_t i = 0; i < 10; ++i) - crashed_vehicle_particle_create(colours, x - 4, y + 8, z); + crashed_vehicle_particle_create(colours, { x - 4, y + 8, z }); flags |= SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; animation_frame = 0; diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/world/Particle.cpp index b13693552c..22c0a23a0e 100644 --- a/src/openrct2/world/Particle.cpp +++ b/src/openrct2/world/Particle.cpp @@ -27,7 +27,7 @@ template<> bool SpriteBase::Is() const * * rct2: 0x006735A1 */ -void crashed_vehicle_particle_create(rct_vehicle_colour colours, int32_t x, int32_t y, int32_t z) +void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos) { VehicleCrashParticle* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->crashed_vehicle_particle; if (sprite != nullptr) @@ -38,7 +38,7 @@ void crashed_vehicle_particle_create(rct_vehicle_colour colours, int32_t x, int3 sprite->sprite_height_negative = 8; sprite->sprite_height_positive = 8; sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC; - sprite->MoveTo({ x, y, z }); + sprite->MoveTo(vehiclePos); sprite->type = SPRITE_MISC_CRASHED_VEHICLE_PARTICLE; sprite->frame = (scenario_rand() & 0xFF) * 12; diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 14088e2306..c23fe318b4 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -249,7 +249,7 @@ uint32_t duck_get_frame_image(const Duck* duck, int32_t direction); /////////////////////////////////////////////////////////////// // Crash particles /////////////////////////////////////////////////////////////// -void crashed_vehicle_particle_create(rct_vehicle_colour colours, int32_t x, int32_t y, int32_t z); +void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos); void crashed_vehicle_particle_update(VehicleCrashParticle* particle); void crash_splash_create(int32_t x, int32_t y, int32_t z); void crash_splash_update(CrashSplashParticle* splash);