From e6eef288f86dcc16aa2b5ba20c9079ead78f17e2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Oct 2014 17:00:39 +0300 Subject: Move ATK stat from net enum into attributes. --- src/being/attributes.h | 3 ++- src/being/playerinfo.cpp | 14 +++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/being') diff --git a/src/being/attributes.h b/src/being/attributes.h index e7d6498b8..3cb0e05f0 100644 --- a/src/being/attributes.h +++ b/src/being/attributes.h @@ -53,7 +53,8 @@ namespace Attributes HIT, MDEF, MATK, - DEF + DEF, + ATK }; } // namespace Attributes diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 359069471..4f7b714cf 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -370,17 +370,13 @@ void setTrading(const bool trading) void updateAttrs() { - const Net::PlayerHandler *const handler = playerHandler; - if (!handler) - return; - const int attr = handler->getAttackLocation(); const int attackDelay = getStatBase(Attributes::ATTACK_DELAY); - if (attr != -1 && attackDelay) + if (attackDelay) { - setStatBase(Attributes::ATTACK_SPEED, getStatBase(attr) * 1000 - / attackDelay, false); - setStatMod(Attributes::ATTACK_SPEED, getStatMod(attr) * 1000 - / attackDelay, true); + setStatBase(Attributes::ATTACK_SPEED, + getStatBase(Attributes::ATK) * 1000 / attackDelay, false); + setStatMod(Attributes::ATTACK_SPEED, + getStatMod(Attributes::ATK) * 1000 / attackDelay, true); } else { -- cgit v1.2.3-60-g2f50