MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / findFreeObjectId

Function findFreeObjectId

src/OpenLoco/src/Objects/ObjectManager.cpp:576–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574 }
575
576 static std::optional<LoadedObjectId> findFreeObjectId(const ObjectType type)
577 {
578 for (LoadedObjectId id = 0; id < getMaxObjects(type); ++id)
579 {
580 if (getAny({ type, id }) == nullptr)
581 {
582 return id;
583 }
584 }
585 return std::nullopt;
586 }
587
588 // 0x00471FF8
589 void unload(const ObjectHeader& header)

Callers 1

loadFunction · 0.85

Calls 2

getMaxObjectsFunction · 0.85
getAnyFunction · 0.85

Tested by

no test coverage detected