summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r--src/playerinfo.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index 3bb196921..769d24a16 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -31,6 +31,9 @@
#include "resources/itemdb.h"
#include "resources/iteminfo.h"
+#include "net/net.h"
+#include "net/playerhandler.h"
+
#include "debug.h"
namespace PlayerInfo
@@ -280,6 +283,23 @@ void setTrading(bool trading)
}
}
+void updateAttrs()
+{
+ int attr = Net::getPlayerHandler()->getAttackLocation();
+ if (attr != -1 && getStatBase(ATTACK_DELAY))
+ {
+ setStatBase(ATTACK_SPEED, getStatBase(attr) * 1000 / getStatBase(
+ ATTACK_DELAY), false);
+ setStatMod(ATTACK_SPEED, getStatMod(attr) * 1000 / getStatBase(
+ ATTACK_DELAY), true);
+ }
+ else
+ {
+ setStatBase(ATTACK_SPEED, 0, false);
+ setStatMod(ATTACK_SPEED, 0, true);
+ }
+}
+
class PlayerInfoListener : Mana::Listener
{
public: