summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-23 01:51:17 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-23 01:51:17 +0300
commitfe39570810969993f51a0ff6045d0a5d4397a5e5 (patch)
tree6d9641f625fdee333143934c0251cfa0dd870bd3 /src/being.cpp
parentcff9e8d8f4bd6b678ad420c9e17eff729eecae4d (diff)
downloadmv-fe39570810969993f51a0ff6045d0a5d4397a5e5.tar.gz
mv-fe39570810969993f51a0ff6045d0a5d4397a5e5.tar.bz2
mv-fe39570810969993f51a0ff6045d0a5d4397a5e5.tar.xz
mv-fe39570810969993f51a0ff6045d0a5d4397a5e5.zip
Show speach messages variable time, depend on message size.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp
index df698cf30..b995338a4 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -447,6 +447,12 @@ void Being::setSpeech(const std::string &text, int time)
if (mSpeech.length() < 1)
return;
+ if (!time && mSpeech.size() < 200)
+ time = SPEECH_TIME - 300 + (3 * mSpeech.size());
+
+ if (time < SPEECH_MIN_TIME)
+ time = SPEECH_MIN_TIME;
+
// Check for links
std::string::size_type start = mSpeech.find('[');
std::string::size_type end = mSpeech.find(']', start);