From 8a28bac6a6231d2dd041cdc661bdeb10abe6c254 Mon Sep 17 00:00:00 2001 From: gerstrong Date: Wed, 5 Aug 2009 14:27:51 +0000 Subject: [PATCH] fixed a string bug which threw out an exeception in finale of ep1 and 2 git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@211 4df4b0f3-56ce-47cb-b001-ed939b7d65a6 --- src/eseq_ep1.cpp | 3 ++- src/eseq_ep2.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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);