diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-12 21:05:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-13 00:47:48 +0300 |
commit | f085c8aed70d5efaaccfa7a4e2cac4a840935165 (patch) | |
tree | 9a77f4c478a26869b98ffa5b40ae50e18ba3ca2b /src/net/tmwa | |
parent | a366d82dad85389c9562fdfdd3a981894603fa07 (diff) | |
download | plus-f085c8aed70d5efaaccfa7a4e2cac4a840935165.tar.gz plus-f085c8aed70d5efaaccfa7a4e2cac4a840935165.tar.bz2 plus-f085c8aed70d5efaaccfa7a4e2cac4a840935165.tar.xz plus-f085c8aed70d5efaaccfa7a4e2cac4a840935165.zip |
Set group id from net code to not only local player.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/beingrecv.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp index d9e058955..7a1b86356 100644 --- a/src/net/tmwa/beingrecv.cpp +++ b/src/net/tmwa/beingrecv.cpp @@ -61,6 +61,31 @@ extern OkDialog *deathNotice; namespace TmwAthena { +static void setGm(Being *const dstBeing, + const uint16_t gmstatus) +{ + if (dstBeing != localPlayer) + { + if ((gmstatus & 0x80) != 0) + { + dstBeing->setGroupId(60); + dstBeing->setGM(true); + } + else + { + dstBeing->setGroupId(0); + dstBeing->setGM(false); + } + } + else + { + if ((gmstatus & 0x80) != 0) + dstBeing->setGM(true); + else + dstBeing->setGM(false); + } +} + void BeingRecv::processBeingChangeLook(Net::MessageIn &msg) { BLOCK_START("BeingRecv::processBeingChangeLook") @@ -349,8 +374,7 @@ void BeingRecv::processPlayerUpdate1(Net::MessageIn &msg) const uint16_t gmstatus = msg.readInt16("gm status"); - if ((gmstatus & 0x80) != 0) - dstBeing->setGM(true); + setGm(dstBeing, gmstatus); applyPlayerAction(msg, dstBeing, msg.readUInt8("action type")); const int level = CAST_S32(msg.readUInt8("level")); @@ -494,8 +518,7 @@ void BeingRecv::processPlayerUpdate2(Net::MessageIn &msg) const uint16_t gmstatus = msg.readInt16("gm status"); - if ((gmstatus & 0x80) != 0) - dstBeing->setGM(true); + setGm(dstBeing, gmstatus); applyPlayerAction(msg, dstBeing, msg.readUInt8("action type")); const int level = CAST_S32(msg.readUInt8("level")); @@ -659,8 +682,7 @@ void BeingRecv::processPlayerMove(Net::MessageIn &msg) const uint16_t gmstatus = msg.readInt16("gm status"); - if ((gmstatus & 0x80) != 0) - dstBeing->setGM(true); + setGm(dstBeing, gmstatus); msg.readUInt8("unused"); |