summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-15 14:15:27 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-15 14:15:34 +0100
commit278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e (patch)
treee1a095b48e34b844405801f7240501fe89579b38 /src/net
parent2779eb792a04667958feab9b433c1c82392c0bc3 (diff)
downloadmana-278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e.tar.gz
mana-278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e.tar.bz2
mana-278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e.tar.xz
mana-278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e.zip
Fix handling of non-consecutive emote IDs
Previous code was assuming there would be no gaps in the emote IDs. Also cleaned up some confusion where the "emote ID" being passed around in the code was often offset by 1. Now it is only offset in communication with tmwAthena and when saving the shortcuts.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/beinghandler.cpp2
-rw-r--r--src/net/tmwa/playerhandler.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 33908fc9..4c7e18bb 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -402,7 +402,7 @@ void BeingHandler::handleMessage(MessageIn &msg)
if (player_relations.hasPermission(dstBeing, PlayerRelation::EMOTE))
{
- const int fx = EmoteDB::get(msg.readInt8() - 1)->effect;
+ const int fx = EmoteDB::get(msg.readInt8() - 1).effectId;
effectManager->trigger(fx, dstBeing);
}
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 9c1a7135..431137fd 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -534,7 +534,7 @@ void PlayerHandler::attack(int id)
void PlayerHandler::emote(int emoteId)
{
MessageOut outMsg(CMSG_PLAYER_EMOTE);
- outMsg.writeInt8(emoteId);
+ outMsg.writeInt8(emoteId + 1);
}
void PlayerHandler::increaseAttribute(int attr)