summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-06 19:02:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-06 19:02:06 +0300
commitbefcee0b12005706f29650cfbef425fc3b8a77b0 (patch)
tree494bf82ec509a80a534d895cffad07f50af7fea4 /src/being
parentf4ccfe30c324365123c50bb56cd4b8166bd1f494 (diff)
downloadplus-befcee0b12005706f29650cfbef425fc3b8a77b0.tar.gz
plus-befcee0b12005706f29650cfbef425fc3b8a77b0.tar.bz2
plus-befcee0b12005706f29650cfbef425fc3b8a77b0.tar.xz
plus-befcee0b12005706f29650cfbef425fc3b8a77b0.zip
In crazy moves A add support for all emotes.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/localplayer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 529f2c73a..84b18774c 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -66,6 +66,8 @@
#include "resources/iteminfo.h"
+#include "resources/db/emotedb.h"
+
#include "utils/gettext.h"
#include "utils/timer.h"
@@ -2988,14 +2990,18 @@ void LocalPlayer::crazyMoveA()
if (emo == '?')
{
srand(tick_time);
- emote(static_cast<unsigned char>(1 + (rand() % 13)));
+ emote(static_cast<unsigned char>(1 + (rand() % EmoteDB::size())));
}
else
{
+ unsigned char emoteId = 0;
if (emo >= '0' && emo <= '9')
- emote(static_cast<unsigned char>(emo - '0' + 1));
- else if (emo >= 'a' && emo <= 'd')
- emote(static_cast<unsigned char>(emo - 'a' + 11));
+ emoteId = static_cast<unsigned char>(emo - '0' + 1);
+ else if (emo >= 'a' && emo <= 'z')
+ emoteId = static_cast<unsigned char>(emo - 'a' + 11);
+ else if (emo >= 'A' && emo <= 'Z')
+ emoteId = static_cast<unsigned char>(emo - 'A' + 37);
+ emote(emoteId);
}
mCrazyMoveState ++;