diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-14 18:59:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-14 18:59:14 +0300 |
commit | 0ff5548da398fa389db6a81f3e2fea9d4fc74e73 (patch) | |
tree | 4db066b1876fadb8dd1b1003ce8ec73438490554 /src/being | |
parent | cf71ad5db541cba69d9214aa4df5752d8c7eec80 (diff) | |
download | manaverse-0ff5548da398fa389db6a81f3e2fea9d4fc74e73.tar.gz manaverse-0ff5548da398fa389db6a81f3e2fea9d4fc74e73.tar.bz2 manaverse-0ff5548da398fa389db6a81f3e2fea9d4fc74e73.tar.xz manaverse-0ff5548da398fa389db6a81f3e2fea9d4fc74e73.zip |
Use branch prediction macro in Being::logic.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index cfb182355..95142fecc 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1760,13 +1760,18 @@ void Being::nextTile() restrict2 void Being::logic() restrict2 { BLOCK_START("Being::logic") - // Reduce the time that speech is still displayed - if (mSpeechTime > 0) + if (A_UNLIKELY(mSpeechTime != 0)) + { mSpeechTime--; - - // Remove text and speechbubbles if speech boxes aren't being used - if (mSpeechTime == 0 && mText) - delete2(mText) + if (mSpeechTime == 0 && mText != nullptr) + { + delete2(mText) + } + else if (mText != nullptr) + { + delete2(mText) + } + } const int time = tick_time * MILLISECONDS_IN_A_TICK; if (mEmotionSprite) |