diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 544eb9d2a0..dd60972f55 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7153,7 +7153,7 @@ static void steam_particle_create(int16_t x, int16_t y, int16_t z) TileElement* tileElement = map_get_surface_element_at({ x, y }); if (tileElement != nullptr && z > tileElement->base_height * 8) { - rct_steam_particle* steam = (rct_steam_particle*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_steam_particle* steam = &create_sprite(SPRITE_IDENTIFIER_MISC)->steam_particle; if (steam == nullptr) return; diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index e882343d46..28e43e4e9f 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -43,7 +43,7 @@ void rct_money_effect::CreateAt(money32 value, int32_t x, int32_t y, int32_t z, if (value == MONEY(0, 00)) return; - rct_money_effect* moneyEffect = (rct_money_effect*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_money_effect* moneyEffect = &create_sprite(SPRITE_IDENTIFIER_MISC)->money_effect; if (moneyEffect == nullptr) return; diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/world/Particle.cpp index 70dc1bdf3c..d675ac9593 100644 --- a/src/openrct2/world/Particle.cpp +++ b/src/openrct2/world/Particle.cpp @@ -20,7 +20,7 @@ */ void crashed_vehicle_particle_create(rct_vehicle_colour colours, int32_t x, int32_t y, int32_t z) { - rct_crashed_vehicle_particle* sprite = (rct_crashed_vehicle_particle*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_crashed_vehicle_particle* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->crashed_vehicle_particle; if (sprite != nullptr) { sprite->colour[0] = colours.body_colour; @@ -114,7 +114,7 @@ void crashed_vehicle_particle_update(rct_crashed_vehicle_particle* particle) */ void crash_splash_create(int32_t x, int32_t y, int32_t z) { - rct_sprite_generic* sprite = (rct_sprite_generic*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_sprite_generic* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic; if (sprite != nullptr) { sprite->sprite_width = 33; diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 002bed3615..68cc830981 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -485,7 +485,7 @@ static void sprite_steam_particle_update(rct_steam_particle* steam) */ void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z) { - rct_sprite_generic* sprite = (rct_sprite_generic*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_sprite_generic* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic; if (sprite != nullptr) { sprite->sprite_width = 44; @@ -518,7 +518,7 @@ static void sprite_misc_explosion_cloud_update(rct_sprite* sprite) */ void sprite_misc_explosion_flare_create(int32_t x, int32_t y, int32_t z) { - rct_sprite_generic* sprite = (rct_sprite_generic*)create_sprite(SPRITE_IDENTIFIER_MISC); + rct_sprite_generic* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic; if (sprite != nullptr) { sprite->sprite_width = 25;