diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-06 19:32:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-06 19:32:33 +0300 |
commit | 960401cc2b219dbaf0a07cbc1077dd3e26718762 (patch) | |
tree | 74442b33859560080c96487e777c151c00008ac3 /src/being | |
parent | befcee0b12005706f29650cfbef425fc3b8a77b0 (diff) | |
download | manaplus-960401cc2b219dbaf0a07cbc1077dd3e26718762.tar.gz manaplus-960401cc2b219dbaf0a07cbc1077dd3e26718762.tar.bz2 manaplus-960401cc2b219dbaf0a07cbc1077dd3e26718762.tar.xz manaplus-960401cc2b219dbaf0a07cbc1077dd3e26718762.zip |
Add new crazy move A command for show pet emotes.
New command: E.
it accept argument for emote number or "?" for random emote.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 84b18774c..8a2f86421 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -62,6 +62,7 @@ #include "net/chathandler.h" #include "net/inventoryhandler.h" #include "net/net.h" +#include "net/pethandler.h" #include "net/playerhandler.h" #include "resources/iteminfo.h" @@ -2983,26 +2984,32 @@ void LocalPlayer::crazyMoveA() pickUpItems(); } // emote - else if (mMoveProgram[mCrazyMoveState] == 'e') + else if (mMoveProgram[mCrazyMoveState] == 'e' + || mMoveProgram[mCrazyMoveState] == 'E') { mCrazyMoveState ++; const signed char emo = mMoveProgram[mCrazyMoveState]; + unsigned char emoteId = 0; if (emo == '?') { srand(tick_time); - emote(static_cast<unsigned char>(1 + (rand() % EmoteDB::size()))); + emoteId = static_cast<unsigned char>( + 1 + (rand() % EmoteDB::size())); } else { - unsigned char emoteId = 0; if (emo >= '0' && emo <= '9') 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); + } + if (mMoveProgram[mCrazyMoveState] == 'e') + emote(emoteId); + else + Net::getPetHandler()->emote(emoteId, 0); mCrazyMoveState ++; } |