From cf3483b4027aa0371a7da1a83b76b799c14b5d57 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:44:30 -0500 Subject: [PATCH] [Bots] Fix timers loading on spawn and zone (#4516) Timers were not properly checking their expiration time on spawn and load and could cause invalid timers to load if the server was restarted resulting in improper lockouts. --- zone/bot_database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 3a07b26495..dcc5ff89b5 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -828,7 +828,7 @@ bool BotDatabase::LoadTimers(Bot* b) BotTimer_Struct t{ }; for (const auto& e : l) { - if (t.timer_value < (Timer::GetCurrentTime() + t.recast_time)) { + if (e.timer_value < (Timer::GetCurrentTime() + e.recast_time)) { t.timer_id = e.timer_id; t.timer_value = e.timer_value; t.recast_time = e.recast_time;