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:
committed by
Gymnasiast
parent
c345396765
commit
243142664e
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user