summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/text.cpp
diff options
context:
space:
mode:
authorZaba999 <qrwfw5rp>2012-10-11 23:09:29 +0200
committerZaba999 <qrwfw5rp>2012-10-11 23:09:29 +0200
commit8a932fed3e5700af283017deab3cb1da11cb0dce (patch)
tree892d7a4068c843cb41bd202f078b042027a0a3d0 /src/graphics/engine/text.cpp
parent3f7f013168e62693601ab57108d329ffaa924439 (diff)
downloadcolobot-8a932fed3e5700af283017deab3cb1da11cb0dce.tar.gz
colobot-8a932fed3e5700af283017deab3cb1da11cb0dce.tar.bz2
colobot-8a932fed3e5700af283017deab3cb1da11cb0dce.zip
Added saving user scripts on game save. Fixed bug in writing script to file.
Diffstat (limited to 'src/graphics/engine/text.cpp')
-rw-r--r--src/graphics/engine/text.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp
index 6355aed..66c73a9 100644
--- a/src/graphics/engine/text.cpp
+++ b/src/graphics/engine/text.cpp
@@ -407,10 +407,10 @@ int CText::Justify(const std::string &text, FontType font, float size, float wid
if (len >= 3)
ch.c3 = text[index+2];
- index += len;
-
if (ch.c1 == '\n')
+ {
return index+1;
+ }
if (ch.c1 == ' ' )
cut = index+1;
@@ -421,6 +421,7 @@ int CText::Justify(const std::string &text, FontType font, float size, float wid
if (cut == 0) return index;
else return cut;
}
+ index += len;
}
return index;