1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 08:12:53 +01:00

Reduce use of get_sprite (#12382)

* Reduce use of get_sprite

* Update src/openrct2/world/Sprite.cpp

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
This commit is contained in:
Duncan
2020-07-25 18:03:14 +01:00
committed by GitHub
parent b70716d5f6
commit 3de2de9814
4 changed files with 21 additions and 12 deletions

View File

@@ -108,7 +108,7 @@ static std::unique_ptr<GameState_t> GetGameState(std::unique_ptr<IContext>& cont
std::unique_ptr<GameState_t> res = std::make_unique<GameState_t>();
for (size_t spriteIdx = 0; spriteIdx < MAX_SPRITES; spriteIdx++)
{
rct_sprite* sprite = get_sprite(spriteIdx);
rct_sprite* sprite = reinterpret_cast<rct_sprite*>(GetEntity(spriteIdx));
if (sprite == nullptr)
res->sprites[spriteIdx].generic.sprite_identifier = SPRITE_IDENTIFIER_NULL;
else