diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-27 22:35:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-27 22:35:38 +0300 |
commit | 9429dc4f5b5b6102a8b575de25ce5d8e7170551f (patch) | |
tree | d4603ddbea06f75e8637a1ff94da4432d7b96951 /src/net | |
parent | 64d30eda264c342aced8d791b47a35def0e4d15c (diff) | |
download | manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.gz manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.bz2 manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.xz manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.zip |
Change player job level, exp from stat object to attribute.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/charserverrecv.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/tmwa/sp.h | 2 |
5 files changed, 19 insertions, 28 deletions
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index 3178a6d5f..f60fb1ff0 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -91,15 +91,17 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, else data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("exp"); data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - Stat &jobStat = data.mStats[Attributes::PLAYER_JOB]; if (packetVersion >= 20170830) - jobStat.exp = msg.readInt64("job exp"); + { + data.mAttributes[Attributes::PLAYER_JOB_EXP] = + msg.readInt64("job exp"); + } else - jobStat.exp = msg.readInt32("job exp"); - - const int temp = msg.readInt32("job level"); - jobStat.base = temp; - jobStat.mod = temp; + { + data.mAttributes[Attributes::PLAYER_JOB_EXP] = + msg.readInt32("job exp"); + } + data.mAttributes[Attributes::PLAYER_JOB] =msg.readInt32("job level"); msg.readInt16("shoes?"); const int gloves = msg.readInt16("gloves"); diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index c7361e1b0..9106fce26 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -532,8 +532,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); break; case Sp::JOBEXP: - PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, base, - PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).second); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP, base); break; case Sp::KARMA: PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); @@ -632,11 +631,8 @@ void PlayerHandler::setStat(Net::MessageIn &msg, case Sp::NEXTBASEEXP: PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); break; - // ++ here used in wrong way. Need like Sp::NEXTBASEEXP? case Sp::NEXTJOBEXP: - PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, - PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).first, - base); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP_NEEDED, base); break; case Sp::WEIGHT: PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); @@ -708,7 +704,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::updateAttrs(); break; case Sp::JOBLEVEL: - PlayerInfo::setStatBase(Attributes::PLAYER_JOB, base); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB, base); break; default: diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp index 50571b29c..474595bf0 100644 --- a/src/net/tmwa/charserverrecv.cpp +++ b/src/net/tmwa/charserverrecv.cpp @@ -72,14 +72,10 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, msg.readBeingId("account id"), BeingTypeId_zero); PlayerInfoBackend &data = character->data; - data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("exp"); + data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("base exp"); data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - Stat &jobStat = data.mStats[Attributes::PLAYER_JOB]; - jobStat.exp = msg.readInt32("job"); - - const int temp = msg.readInt32("job level"); - jobStat.base = temp; - jobStat.mod = temp; + data.mAttributes[Attributes::PLAYER_JOB_EXP] = msg.readInt32("job exp"); + data.mAttributes[Attributes::PLAYER_JOB] = msg.readInt32("job level"); const int shoes = msg.readInt16("shoes"); const int gloves = msg.readInt16("gloves"); diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index d234a6a4a..e31539cd6 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -233,8 +233,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); break; case Sp::JOBEXP: - PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, base, - PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).second); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP, base); break; case Sp::KARMA: PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); @@ -334,9 +333,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); break; case Sp::JOB_MOD: - PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, - PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).first, - base); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP_NEEDED, base); break; case Sp::WEIGHT: PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); @@ -408,7 +405,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::updateAttrs(); break; case Sp::JOBLEVEL: - PlayerInfo::setStatBase(Attributes::PLAYER_JOB, base); + PlayerInfo::setAttribute(Attributes::PLAYER_JOB, base); break; case Sp::GM_LEVEL: localPlayer->setGroupId(base); diff --git a/src/net/tmwa/sp.h b/src/net/tmwa/sp.h index 018504e05..10711bfce 100644 --- a/src/net/tmwa/sp.h +++ b/src/net/tmwa/sp.h @@ -49,7 +49,7 @@ namespace Sp ZENY = 20, SEX = 21, NEXTBASEEXP = 22, - JOB_MOD = 23, + JOB_MOD = 23, // SP_NEXTJOBEXP WEIGHT = 24, MAXWEIGHT = 25, USTR = 32, |