mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
Minor Bug Fix
-Now link won't get soft locked when warping to the same location twice
This commit is contained in:
parent
d8b8316af6
commit
dacf2059c6
1 changed files with 22 additions and 4 deletions
|
@ -16,6 +16,8 @@ extern bool IsSaveLoadedWrapper();
|
||||||
|
|
||||||
static PauseWarpState state;
|
static PauseWarpState state;
|
||||||
|
|
||||||
|
static int lastPlayedSong = -1;
|
||||||
|
|
||||||
bool IsPauseWarpEnabled() {
|
bool IsPauseWarpEnabled() {
|
||||||
return CVarGetInteger("gPauseWarpEnabled", 0) && IsSaveLoadedWrapper();
|
return CVarGetInteger("gPauseWarpEnabled", 0) && IsSaveLoadedWrapper();
|
||||||
}
|
}
|
||||||
|
@ -72,11 +74,27 @@ void PauseWarp_Idle() {
|
||||||
|
|
||||||
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) return ResetStateFlags(&state);
|
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) return ResetStateFlags(&state);
|
||||||
|
|
||||||
|
int currentSong = play->pauseCtx.cursorPoint[PAUSE_QUEST];
|
||||||
|
|
||||||
switch (play->msgCtx.msgMode) {
|
switch (play->msgCtx.msgMode) {
|
||||||
case 6: if (state.warpInitiated) state.textboxInitiated = true; break;
|
case 6:
|
||||||
case 53: if (state.warpInitiated && state.textboxInitiated) state.inChoosingState = true; break;
|
if (state.warpInitiated) state.textboxInitiated = true;
|
||||||
case 54: if (state.warpInitiated && state.textboxInitiated && state.inChoosingState) HandleWarpConfirmation(play, player); break;
|
break;
|
||||||
case 0: ResetStateFlags(&state); break;
|
case 53:
|
||||||
|
if (state.warpInitiated && state.textboxInitiated) state.inChoosingState = true;
|
||||||
|
break;
|
||||||
|
case 54:
|
||||||
|
if (state.warpInitiated && state.textboxInitiated && state.inChoosingState) {
|
||||||
|
HandleWarpConfirmation(play, player);
|
||||||
|
lastPlayedSong = currentSong; // Update the last played song
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
if (currentSong == lastPlayedSong) {
|
||||||
|
// Reset state flags if the same song is selected twice
|
||||||
|
ResetStateFlags(&state);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleCooldowns();
|
HandleCooldowns();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue