[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 authored and GitHub committed 2024-03-23 00:01:15 -05:00
1 parent 66cc947b2a
commit e4157f0221
2 files changed
+8 -11

No files matched your search

+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) {