summaryrefslogtreecommitdiff
path: root/src/net/ea/playerhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-11-24 14:41:09 -0700
committerJared Adams <jaxad0127@gmail.com>2009-11-24 14:41:09 -0700
commitfcc940800c047322aea40da5a24d9d5c0fbd051e (patch)
tree8249555c102bf51af4f4996a9af4f22bbd65838a /src/net/ea/playerhandler.cpp
parent1d5a5c6d4d1125a57c60058cf9c1e49633236f32 (diff)
downloadMana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.gz
Mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.bz2
Mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.tar.xz
Mana-fcc940800c047322aea40da5a24d9d5c0fbd051e.zip
Fix increasing attributes that are at max
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r--src/net/ea/playerhandler.cpp60
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);