mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Fix object dependency for objects loaded after scene init (#14)
This commit is contained in:
@@ -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]) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user