InfTable Check Location Fixes: Lost Dog Richard, Rolling Gorons, HBA 1000, Thawed Zora

This commit is contained in:
sonoftunk 2022-11-07 06:24:14 -05:00
parent d77487f06f
commit 8eabef6c42

View File

@ -677,7 +677,10 @@ bool HasItemBeenCollected(RandomizerCheckObject obj) {
case SpoilerCollectionCheckType::SPOILER_CHK_GOLD_SKULLTULA: case SpoilerCollectionCheckType::SPOILER_CHK_GOLD_SKULLTULA:
return GET_GS_FLAGS(scene) & flag; return GET_GS_FLAGS(scene) & flag;
case SpoilerCollectionCheckType::SPOILER_CHK_INF_TABLE: case SpoilerCollectionCheckType::SPOILER_CHK_INF_TABLE:
return gSaveContext.infTable[scene] & (0x01 << flag); // Magic to flip an index `flag` to a lookup for 16bit big endian integers. Probably an easier way.....
shift = 7 - (flag % 8) + ((flag % 16) / 8) * 8;
mask = 0x8000 >> shift;
return gSaveContext.infTable[scene] & mask;
case SpoilerCollectionCheckType::SPOILER_CHK_ITEM_GET_INF: case SpoilerCollectionCheckType::SPOILER_CHK_ITEM_GET_INF:
// Magic to flip an index `flag` to a lookup for 16bit big endian integers. Probably an easier way..... // Magic to flip an index `flag` to a lookup for 16bit big endian integers. Probably an easier way.....
shift = 7 - (flag % 8) + ((flag % 16) / 8) * 8; shift = 7 - (flag % 8) + ((flag % 16) / 8) * 8;