diff --git a/src/eseq_ep1.cpp b/src/eseq_ep1.cpp index d7cf6ae0f..a0e4b3a1f 100644 --- a/src/eseq_ep1.cpp +++ b/src/eseq_ep1.cpp @@ -336,7 +336,8 @@ int dlgX, dlgY, dlgW, dlgH; // draw the current text line up to the amount currently shown tempbuf = text[textline]; - tempbuf.erase(amountshown); + if(amountshown < tempbuf.size()) + tempbuf.erase(amountshown); g_pGraphics->sb_font_draw( tempbuf, (dlgX+1)*8, (dlgY+1)*8); if (state==STATE_TEXTAPPEARING) diff --git a/src/eseq_ep2.cpp b/src/eseq_ep2.cpp index 1a61f2afc..5f4f89812 100644 --- a/src/eseq_ep2.cpp +++ b/src/eseq_ep2.cpp @@ -383,6 +383,7 @@ int cancel, lastcancelstate; // draw the text up to the amount currently shown tempbuf = text; + if(amountshown < tempbuf.size()) tempbuf.erase(amountshown); sb_dialogbox(boxleft,boxtop,boxwidth,boxheight); g_pGraphics->sb_font_draw( tempbuf, (boxleft+1)*8, (boxtop+1+textline)*8);