sub_808F1B4

This commit is contained in:
scnorton
2017-09-11 10:40:34 -04:00
parent 7c40186e35
commit 2b9b75a824
2 changed files with 18 additions and 50 deletions

View File

@@ -1577,3 +1577,21 @@ struct MapObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, st
}
return NULL;
}
struct MapObjectTemplate *sub_808F1B4(struct MapObject *mapObject)
{
int i;
if (mapObject->mapNum != gSaveBlock1Ptr->location.mapNum || mapObject->mapGroup != gSaveBlock1Ptr->location.mapGroup)
{
return NULL;
}
for (i = 0; i < 64; i ++) // Using ARRAY_COUNT here results in the wrong conditional branch instruction (bls instead of ble)
{
if (mapObject->localId == gSaveBlock1Ptr->mapObjectTemplates[i].localId)
{
return &gSaveBlock1Ptr->mapObjectTemplates[i];
}
}
return NULL;
}