diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-11-24 14:41:09 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-24 14:41:09 -0700 |
commit | fcc940800c047322aea40da5a24d9d5c0fbd051e (patch) | |
tree | 8249555c102bf51af4f4996a9af4f22bbd65838a /src/net | |
parent | 1d5a5c6d4d1125a57c60058cf9c1e49633236f32 (diff) | |
download | mana-client-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.gz mana-client-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.bz2 mana-client-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.xz mana-client-fcc940800c047322aea40da5a24d9d5c0fbd051e.zip |
Fix increasing attributes that are at max
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/playerhandler.cpp | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 3055e934..dd0d099a 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -372,32 +372,80 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) int val = msg.readInt8(); player_node->setAttributeEffective(STR, val + ATTR_BONUS(STR)); player_node->setAttributeBase(STR, val); - statusWindow->setPointsNeeded(STR, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(STR, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(STR, msg.readInt8()); + } val = msg.readInt8(); player_node->setAttributeEffective(AGI, val + ATTR_BONUS(AGI)); player_node->setAttributeBase(AGI, val); - statusWindow->setPointsNeeded(AGI, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(AGI, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(AGI, msg.readInt8()); + } val = msg.readInt8(); player_node->setAttributeEffective(VIT, val + ATTR_BONUS(VIT)); player_node->setAttributeBase(VIT, val); - statusWindow->setPointsNeeded(VIT, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(VIT, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(VIT, msg.readInt8()); + } val = msg.readInt8(); player_node->setAttributeEffective(INT, val + ATTR_BONUS(INT)); player_node->setAttributeBase(INT, val); - statusWindow->setPointsNeeded(INT, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(INT, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(INT, msg.readInt8()); + } val = msg.readInt8(); player_node->setAttributeEffective(DEX, val + ATTR_BONUS(DEX)); player_node->setAttributeBase(DEX, val); - statusWindow->setPointsNeeded(DEX, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(DEX, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(DEX, msg.readInt8()); + } val = msg.readInt8(); player_node->setAttributeEffective(LUK, val + ATTR_BONUS(LUK)); player_node->setAttributeBase(LUK, val); - statusWindow->setPointsNeeded(LUK, msg.readInt8()); + if (val >= 99) + { + statusWindow->setPointsNeeded(LUK, 0); + msg.readInt8(); + } + else + { + statusWindow->setPointsNeeded(LUK, msg.readInt8()); + } val = msg.readInt16(); // ATK player_node->setAttributeBase(ATK, val); |