1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Move CreateEntity funcs to Entity header. Remove dead enum

This commit is contained in:
duncanspumpkin
2021-05-29 08:18:23 +01:00
parent 63bcb3c3e5
commit ee981e62e1
4 changed files with 20 additions and 25 deletions

View File

@@ -394,7 +394,7 @@ static void PrepareNewEntity(SpriteBase* base, const EntityType type)
SpriteSpatialInsert(base, { LOCATION_NULL, 0 });
}
rct_sprite* create_sprite(EntityType type)
SpriteBase* CreateEntity(EntityType type)
{
if (_freeIdList.size() == 0)
{
@@ -414,16 +414,16 @@ rct_sprite* create_sprite(EntityType type)
}
}
auto* sprite = GetEntity(_freeIdList.back());
if (sprite == nullptr)
auto* entity = GetEntity(_freeIdList.back());
if (entity == nullptr)
{
return nullptr;
}
_freeIdList.pop_back();
PrepareNewEntity(sprite, type);
PrepareNewEntity(entity, type);
return reinterpret_cast<rct_sprite*>(sprite);
return entity;
}
SpriteBase* CreateEntityAt(const uint16_t index, const EntityType type)