From 243142664e805a8353467e5dbfa0923756803b20 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Wed, 12 May 2021 08:01:08 +0100 Subject: [PATCH] Move balloon methods into class --- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/world/Balloon.cpp | 2 +- src/openrct2/world/Balloon.h | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 20f66ef82d..1ad904946a 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6677,7 +6677,7 @@ void Guest::UpdateSpriteType() isBalloonPopped = true; OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BalloonPop, { x, y, z }); } - create_balloon({ x, y, z + 9 }, BalloonColour, isBalloonPopped); + Balloon::Create({ x, y, z + 9 }, BalloonColour, isBalloonPopped); } RemoveItem(ShopItem::Balloon); WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index daf4e082cc..2066dc5f0b 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -2579,7 +2579,7 @@ static void peep_release_balloon(Guest* peep, int16_t spawn_height) if (peep->SpriteType == PeepSpriteType::Balloon && peep->x != LOCATION_NULL) { - create_balloon({ peep->x, peep->y, spawn_height }, peep->BalloonColour, false); + Balloon::Create({ peep->x, peep->y, spawn_height }, peep->BalloonColour, false); peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; peep->UpdateSpriteType(); } diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/world/Balloon.cpp index 0292601703..4ea3655ada 100644 --- a/src/openrct2/world/Balloon.cpp +++ b/src/openrct2/world/Balloon.cpp @@ -81,7 +81,7 @@ void Balloon::Pop() OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BalloonPop, { x, y, z }); } -void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped) +void Balloon::Create(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped) { auto* balloon = CreateEntity(); if (balloon == nullptr) diff --git a/src/openrct2/world/Balloon.h b/src/openrct2/world/Balloon.h index 2154782d13..46cc2e611e 100644 --- a/src/openrct2/world/Balloon.h +++ b/src/openrct2/world/Balloon.h @@ -20,11 +20,9 @@ struct Balloon : MiscEntity uint16_t popped; uint8_t time_to_move; uint8_t colour; - + static void Create(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped); void Update(); void Pop(); void Press(); void Serialise(DataSerialiser& stream); }; - -void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped);