summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r--src/playerinfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index 4d5074ee..aacff3a1 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -30,6 +30,8 @@
#include "net/inventoryhandler.h"
#include "net/net.h"
+#include "utils/time.h"
+
namespace PlayerInfo {
class PlayerLogic;
@@ -49,7 +51,7 @@ static bool mNPCPostCount = false;
static BuySellState mBuySellState = BUYSELL_NONE;
static std::map<int, Special> mSpecials;
-static char mSpecialRechargeUpdateNeeded = 0;
+static Timer mSpecialRechargeUpdateTimer;
// --- Triggers ---------------------------------------------------------------
@@ -312,9 +314,10 @@ bool isTalking()
void logic()
{
- if ((mSpecialRechargeUpdateNeeded%11) == 0)
+ if (mSpecialRechargeUpdateTimer.passed())
{
- mSpecialRechargeUpdateNeeded = 0;
+ mSpecialRechargeUpdateTimer.set(100);
+
for (auto &special : mSpecials)
{
special.second.currentMana += special.second.recharge;
@@ -324,7 +327,6 @@ void logic()
}
}
}
- mSpecialRechargeUpdateNeeded++;
}
class PlayerLogic : EventListener