Skip to content

Commit

Permalink
Fix fast speed skipping quick text markers (HarbourMasters#4416)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLongstaff authored Oct 16, 2024
1 parent 45af102 commit da79e5e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions soh/src/code/z_message_PAL.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->unk_E3D0 = 0;
charTexIdx = 0;

gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);

for (i = 0; i < msgCtx->textDrawPos; i++) {
character = msgCtx->msgBufDecoded[i];

Expand Down Expand Up @@ -903,9 +905,9 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
*gfxP = gfx;
return;
case MESSAGE_QUICKTEXT_ENABLE:
if (i + 1 == msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING ||
(msgCtx->msgMode >= MSGMODE_OCARINA_STARTING &&
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
if (i < msgCtx->textDrawPos && i + gTextSpeed >= msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING ||
(msgCtx->msgMode >= MSGMODE_OCARINA_STARTING &&
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
j = i;
while (true) {
lookAheadCharacter = msgCtx->msgBufDecoded[j];
Expand All @@ -922,8 +924,10 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break;
}
}
i = j - 1;
msgCtx->textDrawPos = i + 1;
if (j > msgCtx->textDrawPos) {
i = j - 1;
msgCtx->textDrawPos = j;
}

if (character) {}
}
Expand Down Expand Up @@ -1116,8 +1120,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break;
}
}

gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
if (msgCtx->textDelay == 0) {
msgCtx->textDrawPos = i + gTextSpeed;
} else if (msgCtx->textDelayTimer == 0) {
Expand Down

0 comments on commit da79e5e

Please sign in to comment.