Add function to get current dimension for downpour mirror world and mines escape sequence
Opened this issue · 2 comments
TazTxUK commented
Add function to get current dimension for downpour mirror world and mines escape sequence
Zamiell commented
Dead is using this as a workaround currently:
https://cdn.discordapp.com/attachments/123961790529929218/844686209263468585/unknown.png
Zamiell commented
This algorithm is from KingBobson:
export function getCurrentDimension(): Dimension | null {
const game = Game();
const level = game.GetLevel();
const roomIndex = getRoomIndex();
const currentRoomDesc = level.GetCurrentRoomDesc();
const currentRoomHash = GetPtrHash(currentRoomDesc);
for (let dimension = 0; dimension <= 2; dimension++) {
const dimensionRoomDesc = level.GetRoomByIdx(roomIndex, dimension);
const dimensionRoomHash = GetPtrHash(dimensionRoomDesc)
if (dimensionRoomHash === currentRoomHash) {
return dimension;
}
}
return null;
}