[Bug Fix] Fix reusing timers (#4199)

Fixes regression from #4099 where timers that were reused were not getting changed with their updated times
This commit is contained in:
JJ
2024-03-23 01:01:15 -04:00
committed by GitHub
parent 66cc947b2a
commit e4157f0221
2 changed files with 8 additions and 11 deletions
+3 -6
View File
@@ -537,9 +537,8 @@ void QuestManager::settimer(const std::string& timer_name, uint32 seconds, Mob*
);
if (!QTimerList.empty()) {
for (auto e : QTimerList) {
for (auto& e : QTimerList) {
if (e.mob && e.mob == mob && e.name == timer_name) {
e.Timer_.Enable();
e.Timer_.Start(seconds * 1000, false);
if (has_start_event) {
@@ -613,9 +612,8 @@ void QuestManager::settimerMS(const std::string& timer_name, uint32 milliseconds
}
if (!QTimerList.empty()) {
for (auto e : QTimerList) {
for (auto& e : QTimerList) {
if (e.mob && e.mob == owner && e.name == timer_name) {
e.Timer_.Enable();
e.Timer_.Start(milliseconds, false);
if (has_start_event) {
@@ -678,9 +676,8 @@ void QuestManager::settimerMS(const std::string& timer_name, uint32 milliseconds
);
if (!QTimerList.empty()) {
for (auto e : QTimerList) {
for (auto& e : QTimerList) {
if (e.mob && e.mob == m && e.name == timer_name) {
e.Timer_.Enable();
e.Timer_.Start(milliseconds, false);
if (has_start_event) {