summaryrefslogtreecommitdiff
path: root/src/game-server/autoattack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/autoattack.cpp')
-rw-r--r--src/game-server/autoattack.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game-server/autoattack.cpp b/src/game-server/autoattack.cpp
index d433b421..d8425d50 100644
--- a/src/game-server/autoattack.cpp
+++ b/src/game-server/autoattack.cpp
@@ -47,7 +47,11 @@ void AutoAttacks::start()
for (std::list<AutoAttack>::iterator it = mAutoAttacks.begin();
it != mAutoAttacks.end(); ++it)
{
- it->softReset();
+ // If the attack is inactive, we hard reset it.
+ if (!it->getTimer())
+ it->reset();
+ else
+ it->softReset();
}
mActive = true;
}
@@ -57,13 +61,15 @@ void AutoAttacks::tick(std::list<AutoAttack> *ret)
for (std::list<AutoAttack>::iterator it = mAutoAttacks.begin();
it != mAutoAttacks.end(); ++it)
{
- if (it->tick()) {
+ if (it->tick())
+ {
if (mActive)
it->reset();
else
it->halt();
}
- else if (ret && it->isReady())
+
+ if (ret && it->isReady())
{
ret->push_back(*it);
}