Fix object dependency for objects loaded after scene init (#14)

This commit is contained in:
Garrett Cox
2024-05-22 09:04:57 -05:00
parent 6032142870
commit e392725058
2 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ void Scene_CommandObjectList(PlayState* play, LUS::ISceneCommand* cmd) {
s16* entry = (s16*)objList->GetRawPointer();
for (unsigned int i = 0; i < objList->objects.size(); i++) {
bool alreadyIncluded = true;
bool alreadyIncluded = false;
for (unsigned int j = 0; j < play->objectCtx.numEntries; j++) {
if (play->objectCtx.slots[j].id == objList->objects[i]) {
+9 -2
View File
@@ -78,6 +78,14 @@ void Object_UpdateEntries(ObjectContext* objectCtx) {
if (entry->id < 0) {
s32 id = -entry->id;
// #region 2S2H [Port] We don't care to load the object from DMA, consider it already loaded
// There is a weird case handled below that accounts for RomFiles with a size of 0, but according
// to object_table.h there is only one instance of this, along with a bunch of placeholder entries
// so we _should_ be fine. Famous last words.
entry->id = id;
continue;
// #endregion
if (entry->dmaReq.vromAddr == 0) {
objectFile = &gObjectTable[id];
size = objectFile->vromEnd - objectFile->vromStart;
@@ -100,8 +108,7 @@ void Object_UpdateEntries(ObjectContext* objectCtx) {
s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId) {
s32 i;
// BENTODO there has to be a cleaner fix.
return 1;
for (i = 0; i < objectCtx->numEntries; i++) {
if (ABS_ALT(objectCtx->slots[i].id) == objectId) {
return i;