[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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View File

@ -380,12 +380,12 @@ void Perl__settimer(std::string timer_name, uint32 seconds)
void Perl__settimer(std::string timer_name, uint32 seconds, Mob* m)
{
quest_manager.settimer(timer_name, seconds);
quest_manager.settimer(timer_name, seconds, m);
}
void Perl__settimer(std::string timer_name, uint32 seconds, EQ::ItemInstance* inst)
{
quest_manager.settimer(timer_name, seconds);
quest_manager.settimerMS(timer_name, seconds * 1000, inst);
}
void Perl__settimerMS(std::string timer_name, uint32 milliseconds)
@ -6693,9 +6693,9 @@ void perl_register_quest()
package.add("settarget", &Perl__settarget);
package.add("settime", (void(*)(int, int))&Perl__settime);
package.add("settime", (void(*)(int, int, bool))&Perl__settime);
package.add("settimer", (void(*)(std::string, uint32))&Perl__settimer),
package.add("settimer", (void(*)(std::string, uint32, EQ::ItemInstance*))&Perl__settimer),
package.add("settimer", (void(*)(std::string, uint32, Mob*))&Perl__settimer),
package.add("settimer", (void(*)(std::string, uint32))&Perl__settimer);
package.add("settimer", (void(*)(std::string, uint32, EQ::ItemInstance*))&Perl__settimer);
package.add("settimer", (void(*)(std::string, uint32, Mob*))&Perl__settimer);
package.add("settimerMS", (void(*)(std::string, uint32))&Perl__settimerMS);
package.add("settimerMS", (void(*)(std::string, uint32, EQ::ItemInstance*))&Perl__settimerMS);
package.add("settimerMS", (void(*)(std::string, uint32, Mob*))&Perl__settimerMS);

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