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

Use entity list rather than MAX_ENTITIES loop (#14384)

* Use entity list rather than MAX_ENTITIES loop

* Use guest for variable names
This commit is contained in:
Duncan
2021-03-25 08:08:26 +00:00
committed by GitHub
parent 040a3eb144
commit 1be7457e30
3 changed files with 31 additions and 41 deletions

View File

@@ -34,6 +34,7 @@
#include "util/Util.h"
#include "windows/Intent.h"
#include "world/Climate.h"
#include "world/EntityList.h"
#include "world/Entrance.h"
#include "world/Footpath.h"
#include "world/Park.h"
@@ -310,13 +311,13 @@ namespace Editor
ride_init_all();
//
for (int32_t i = 0; i < MAX_ENTITIES; i++)
for (auto* guest : EntityList<Guest>())
{
auto peep = GetEntity<Peep>(i);
if (peep != nullptr)
{
peep->SetName({});
}
guest->SetName({});
}
for (auto* staff : EntityList<Staff>())
{
staff->SetName({});
}
reset_sprite_list();