From 019cc3c3c21682ace6e123fb843c32cdafe8bbc9 Mon Sep 17 00:00:00 2001 From: talamortis Date: Thu, 2 Nov 2017 20:31:14 +0000 Subject: [PATCH 1/2] fixed an issue where timer wouldnt refresh --- src/reward_system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reward_system.cpp b/src/reward_system.cpp index 405a0c3..a46fad9 100644 --- a/src/reward_system.cpp +++ b/src/reward_system.cpp @@ -25,6 +25,7 @@ public: { roll = urand(1, 1000); //Lets make a random number from 1 - 1000 QueryResult result = CharacterDatabase.PQuery("SELECT item, quantity FROM reward_system WHERE roll = '%u'", roll); + rewardtimer = urand(2 * HOUR*IN_MILLISECONDS, 4 * HOUR*IN_MILLISECONDS); if (!result || player->isAFK()) return; @@ -38,7 +39,6 @@ public: // now lets add the item player->AddItem(pItem, quantity); - rewardtimer = urand(2 * HOUR*IN_MILLISECONDS, 4 * HOUR*IN_MILLISECONDS); ChatHandler(player->GetSession()).PSendSysMessage("You have rolled %u which gave you item %u", roll, pItem); } } From f6b567ba6bd2999005706f4fa3266180354591f1 Mon Sep 17 00:00:00 2001 From: talamortis Date: Thu, 2 Nov 2017 20:33:58 +0000 Subject: [PATCH 2/2] indentation fix --- src/reward_system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reward_system.cpp b/src/reward_system.cpp index a46fad9..f45d6be 100644 --- a/src/reward_system.cpp +++ b/src/reward_system.cpp @@ -25,8 +25,8 @@ public: { roll = urand(1, 1000); //Lets make a random number from 1 - 1000 QueryResult result = CharacterDatabase.PQuery("SELECT item, quantity FROM reward_system WHERE roll = '%u'", roll); - rewardtimer = urand(2 * HOUR*IN_MILLISECONDS, 4 * HOUR*IN_MILLISECONDS); - + rewardtimer = urand(2 * HOUR*IN_MILLISECONDS, 4 * HOUR*IN_MILLISECONDS); + if (!result || player->isAFK()) return; else