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

Implement GetSprite and use it in a number of places

This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
This commit is contained in:
duncanspumpkin
2020-06-06 11:32:37 +01:00
parent 0f12382895
commit 904e6c6987
33 changed files with 323 additions and 361 deletions

View File

@@ -1573,11 +1573,11 @@ static int32_t cc_mp_desync(InteractiveConsole& console, const arguments_t& argv
for (int i = 0; i < MAX_SPRITES; i++)
{
rct_sprite* sprite = get_sprite(i);
if (sprite->generic.sprite_identifier == SPRITE_IDENTIFIER_NULL)
auto* sprite = GetEntity(i);
if (sprite->sprite_identifier == SPRITE_IDENTIFIER_NULL)
continue;
auto peep = sprite->generic.As<Peep>();
auto peep = sprite->As<Peep>();
if (peep != nullptr)
peeps.push_back(peep);
}