1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

Move balloon methods into class

This commit is contained in:
duncanspumpkin
2021-05-12 08:01:08 +01:00
committed by Gymnasiast
parent c345396765
commit 243142664e
4 changed files with 4 additions and 6 deletions

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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<Balloon>();
if (balloon == nullptr)

View File

@@ -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);