summaryrefslogtreecommitdiff
path: root/src/net/ea/playerhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-24 14:19:21 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-24 14:19:21 -0600
commitea6f492198a03cffc3be47df000fa16dfc3b262f (patch)
tree01ba3216ecbfa0bf1520211a940d689a8874baba /src/net/ea/playerhandler.cpp
parent6f9ca0023ce77eb74d199a3c2e04e7d2b9d07494 (diff)
downloadMana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.gz
Mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.bz2
Mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.xz
Mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.zip
Remove an ifdef in StatusWindow and update MP more
Also make MiniStatus only update the bars when needed (called by StatusWindow).
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r--src/net/ea/playerhandler.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index ea3f40d5..3528eeee 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -260,10 +260,11 @@ void PlayerHandler::handleMessage(MessageIn &msg)
case 0x002b: player_node->setAttributeEffective(MATK, value
+ ATTR_BONUS(MATK));
- player_node->setAttributeBase(MATK, value); break;
+ player_node->setAttributeBase(MATK, value);
+ statusWindow->update(StatusWindow::MP); break;
case 0x002c: value += player_node->getAttributeBase(MATK);
- player_node->setAttributeEffective(MATK, value); break;
-
+ player_node->setAttributeEffective(MATK, value);
+ statusWindow->update(StatusWindow::MP); break;
case 0x002d: player_node->setAttributeEffective(DEF, value
+ ATTR_BONUS(DEF));
player_node->setAttributeBase(DEF, value); break;
@@ -333,7 +334,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
}
break;
- case SMSG_PLAYER_STAT_UPDATE_3:
+ case SMSG_PLAYER_STAT_UPDATE_3: // Update a base attribute
{
int type = msg.readInt32();
int base = msg.readInt32();
@@ -404,6 +405,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
player_node->setAttributeBase(MATK, val);
val += msg.readInt16(); // MATK bonus
player_node->setAttributeEffective(MATK, val);
+ statusWindow->update(StatusWindow::MP);
val = msg.readInt16(); // DEF
player_node->setAttributeBase(DEF, val);
@@ -560,4 +562,9 @@ void PlayerHandler::ignoreAll(bool ignore)
// TODO
}
+bool PlayerHandler::canUseMagic()
+{
+ return player_node->getAttributeEffective(MATK) > 0;
+}
+
} // namespace EAthena