summaryrefslogtreecommitdiff
path: root/src/net
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
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')
-rw-r--r--src/net/ea/playerhandler.cpp15
-rw-r--r--src/net/ea/playerhandler.h2
-rw-r--r--src/net/playerhandler.h2
-rw-r--r--src/net/tmwserv/playerhandler.cpp5
-rw-r--r--src/net/tmwserv/playerhandler.h2
5 files changed, 22 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
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index 7312dacf..78e64a88 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -58,6 +58,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
void ignorePlayer(const std::string &player, bool ignore);
void ignoreAll(bool ignore);
+
+ bool canUseMagic();
};
} // namespace EAthena
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index 910424b3..a0fd8bac 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -54,6 +54,8 @@ class PlayerHandler
virtual void ignorePlayer(const std::string &player, bool ignore) = 0;
virtual void ignoreAll(bool ignore) = 0;
+
+ virtual bool canUseMagic() = 0;
};
} // namespace Net
diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp
index 91b6dd8a..656befdf 100644
--- a/src/net/tmwserv/playerhandler.cpp
+++ b/src/net/tmwserv/playerhandler.cpp
@@ -390,4 +390,9 @@ void PlayerHandler::ignoreAll(bool ignore)
// TODO
}
+bool PlayerHandler::canUseMagic()
+{
+ return true;
+}
+
} // namespace TmwServ
diff --git a/src/net/tmwserv/playerhandler.h b/src/net/tmwserv/playerhandler.h
index 1c94b4e4..287baa3d 100644
--- a/src/net/tmwserv/playerhandler.h
+++ b/src/net/tmwserv/playerhandler.h
@@ -58,6 +58,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
void ignoreAll(bool ignore);
+ bool canUseMagic();
+
private:
void handleMapChangeMessage(MessageIn &msg);
};