diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d4a14d49e8..a04eef3357 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -714,7 +714,7 @@ void Guest::Tick128UpdateGuest(int32_t index) { audio_play_sound_at_location(SoundId::Crash, { x, y, z }); - sprite_misc_explosion_cloud_create(x, y, z + 16); + sprite_misc_explosion_cloud_create({ x, y, z + 16 }); sprite_misc_explosion_flare_create(x, y, z + 16); Remove(); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 8979b9361b..e30dc71811 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3570,7 +3570,7 @@ void Vehicle::UpdateCollisionSetup() audio_play_sound_at_location(SoundId::Crash, { train->x, train->y, train->z }); - sprite_misc_explosion_cloud_create(train->x, train->y, train->z); + sprite_misc_explosion_cloud_create({ train->x, train->y, train->z }); for (int32_t i = 0; i < 10; i++) { @@ -5294,7 +5294,7 @@ void Vehicle::CrashOnLand() sub_state = 2; audio_play_sound_at_location(SoundId::Crash, { x, y, z }); - sprite_misc_explosion_cloud_create(x, y, z); + sprite_misc_explosion_cloud_create({ x, y, z }); sprite_misc_explosion_flare_create(x, y, z); uint8_t numParticles = std::min(sprite_width, static_cast(7)); @@ -5397,9 +5397,9 @@ void Vehicle::UpdateCrash() curVehicle->crash_z++; if ((scenario_rand() & 0xFFFF) <= 0x1555) { - auto xOffset = (scenario_rand() & 2) - 1; - auto yOffset = (scenario_rand() & 2) - 1; - sprite_misc_explosion_cloud_create(curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z); + int32_t xOffset = (scenario_rand() & 2) - 1; + int32_t yOffset = (scenario_rand() & 2) - 1; + sprite_misc_explosion_cloud_create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); } } if (curVehicle->var_C8 + 7281 > 0xFFFF) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 5134d6fa7a..b4f785563f 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -521,7 +521,7 @@ static void sprite_steam_particle_update(SteamParticle* steam) * * rct2: 0x0067363D */ -void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z) +void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos) { SpriteGeneric* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic; if (sprite != nullptr) @@ -530,7 +530,7 @@ void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z) sprite->sprite_height_negative = 32; sprite->sprite_height_positive = 34; sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC; - sprite->MoveTo({ x, y, z + 4 }); + sprite->MoveTo(cloudPos + CoordsXYZ{ 0, 0, 4 }); sprite->type = SPRITE_MISC_EXPLOSION_CLOUD; sprite->frame = 0; } diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index c6669a8d9b..1ffcf1c4e9 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -222,7 +222,7 @@ void sprite_remove(SpriteBase* sprite); void litter_create(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t type); void litter_remove_at(int32_t x, int32_t y, int32_t z); uint16_t remove_floating_sprites(); -void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z); +void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos); void sprite_misc_explosion_flare_create(int32_t x, int32_t y, int32_t z); uint16_t sprite_get_first_in_quadrant(int32_t x, int32_t y); void sprite_position_tween_store_a();