MCPcopy Create free account
hub / github.com/BanjoRecomp/BanjoRecomp / recomp_get_object_spawn_index

Function recomp_get_object_spawn_index

src/game/recomp_extension_api.cpp:241–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241extern "C" void recomp_get_object_spawn_index(uint8_t* rdram, recomp_context* ctx) {
242 u32 type_index = _arg<0, u32>(rdram, ctx);
243 u32 object_handle = _arg<1, u32>(rdram, ctx);
244 ExtensionContext& context = type_contexts[type_index];
245
246 std::lock_guard lock{ extension_mutex };
247
248
249 extension_data_map_t::key object_key{object_handle};
250 ExtensionData* data = context.extension_data.get(object_key);
251
252 // Check if object handle is valid.
253 if (data == nullptr) {
254 _return<u32>(ctx, 0xFFFFFFFFU);
255 return;
256 }
257
258 _return<u32>(ctx, data->object_spawn_index);
259}
260

Callers 2

Calls 1

getMethod · 0.45

Tested by

no test coverage detected