From aae8960edf5eee2bfd7e8874f596d6fca9db01fa Mon Sep 17 00:00:00 2001 From: Marcos <66353315+marcosvf132@users.noreply.github.com> Date: Wed, 26 Aug 2020 22:36:34 -0300 Subject: [PATCH] Fix: Battle list vocations (#1690) Add possibility to change vocations to be shown on battle list. @FakeShinoda credits. --- src/protocolgame.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/protocolgame.cpp b/src/protocolgame.cpp index cc7bcf9a7..0638e942f 100644 --- a/src/protocolgame.cpp +++ b/src/protocolgame.cpp @@ -3638,9 +3638,14 @@ void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* creature, bo } } - if (creatureType == CREATURETYPE_PLAYER) { - msg.addByte(0); - } + if (creatureType == CREATURETYPE_PLAYER) { + const Player* otherCreature = creature->getPlayer(); + if (otherCreature) { + msg.addByte(otherCreature->getVocation()->getClientId()); + } else { + msg.addByte(0); + } + } msg.addByte(creature->getSpeechBubble()); msg.addByte(0xFF); // MARK_UNMARKED