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

Function getAny

src/OpenLoco/src/Objects/ObjectManager.cpp:142–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 Object* getAny(const LoadedObjectHandle& handle)
143 {
144 auto& ori = getRepositoryItem(handle.type);
145 if (handle.id >= ori.objects.size())
146 {
147 // We shouldn't get here but sometimes we pass null handles like 0xFF and
148 // accidentally get here. Ideally the call sites should be fixed so thats
149 // why we are asserting here.
150 assert(false);
151 return nullptr;
152 }
153 auto obj = ori.objects[handle.id];
154 if (obj == (void*)-1)
155 {
156 obj = nullptr;
157 }
158 return obj;
159 }
160
161 /*
162 static void printHeader(header data)

Callers 6

reloadAllFunction · 0.85
findFreeObjectIdFunction · 0.85
writePackedObjectsFunction · 0.85
unloadFunction · 0.85
getFunction · 0.85
forEachLoadedObjectFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected