From 010fe80b3e44cee70422a1f19367f7630fd8a7ab Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 May 2011 23:13:47 +0300 Subject: Fix reading attack delay. --- src/being.cpp | 1 + src/gui/debugwindow.cpp | 2 +- src/net/tmwa/beinghandler.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index eae4ebd66..2ea399aae 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -206,6 +206,7 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): mErased(false), mEnemy(false), mIp(""), + mAttackDelay(0), mPvpRank(0) { mSpriteRemap = new int[20]; diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index cf52950c3..e9c79a890 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -291,7 +291,7 @@ void TargetDebugTab::logic() const int delay = target->getAttackDelay(); if (delay) { - mAttackDelayLabel = new Label(strprintf("%s %d", + mAttackDelayLabel->setCaption(strprintf("%s %d", _("Attack delay:"), delay)); } else diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 7474eb66c..402a3e7eb 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -486,14 +486,14 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) if (dstBeing) { // Perhaps a new skill attack type should be created and used? - if (dstSpeed) - dstBeing->setAttackDelay(dstSpeed); +// if (dstSpeed) +// dstBeing->setAttackDelay(dstSpeed); dstBeing->takeDamage(srcBeing, param1, Being::HIT); } if (srcBeing) { - if (srcSpeed) - srcBeing->setAttackDelay(srcSpeed); +// if (srcSpeed) +// srcBeing->setAttackDelay(srcSpeed); srcBeing->handleAttack(dstBeing, param1, Being::HIT); } break; @@ -520,14 +520,14 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) case Being::FLEE: // Lucky Dodge if (dstBeing) { - if (dstSpeed) - dstBeing->setAttackDelay(dstSpeed); +// if (dstSpeed) +// dstBeing->setAttackDelay(dstSpeed); dstBeing->takeDamage(srcBeing, param1, static_cast(type)); } if (srcBeing) { - if (srcSpeed) + if (srcSpeed && srcBeing->getType() == Being::PLAYER) srcBeing->setAttackDelay(srcSpeed); srcBeing->handleAttack(dstBeing, param1, static_cast(type)); -- cgit v1.2.3-60-g2f50