diff options
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index ab8700227..a3458c9f8 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -112,6 +112,7 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_BEING_STAT_UPDATE_1, SMSG_MOB_INFO, SMSG_BEING_MOVE3, + SMSG_BEING_ATTRS, 0 }; handledMessages = _messages; @@ -301,6 +302,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processBeingMove3(msg); break; + case SMSG_BEING_ATTRS: + processBeingAttrs(msg); + break; + default: break; } @@ -1546,4 +1551,26 @@ void BeingHandler::processMobInfo(Net::MessageIn &msg) dstBeing->setAttackRange(attackRange); } +void BeingHandler::processBeingAttrs(Net::MessageIn &msg) +{ + const int len = msg.readInt16("len"); + if (len < 12) + return; + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("player id")); + const int gmLevel = msg.readInt32("gm level"); + if (dstBeing && gmLevel) + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(gmLevel); + dstBeing->setGM(true); + } + else + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(0); + dstBeing->setGM(false); + } +} + } // namespace EAthena |