1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +01:00

Tiny GetEntity Refactor (#12124)

* Use default template parameter instead of specialising

* Fix null deref issues
This commit is contained in:
Duncan
2020-07-06 22:02:25 +01:00
committed by GitHub
parent 1a373e115a
commit 94b3598102
7 changed files with 96 additions and 30 deletions

View File

@@ -1573,7 +1573,7 @@ static int32_t cc_mp_desync(InteractiveConsole& console, const arguments_t& argv
for (int i = 0; i < MAX_SPRITES; i++)
{
auto* sprite = GetEntity(i);
if (sprite->sprite_identifier == SPRITE_IDENTIFIER_NULL)
if (sprite == nullptr || sprite->sprite_identifier == SPRITE_IDENTIFIER_NULL)
continue;
auto peep = sprite->As<Peep>();