[Instance] Clear Respawn Timers on Creation (#4801)

* [DZ] Clear Respawn Timers on Creation

* Revert "[DZ] Clear Respawn Timers on Creation"

This reverts commit ae18b77e8361a41c25e9b97812c7a4ab97715bb4.

* Clear respawn times on instance creation
This commit is contained in:
Chris Miles 2025-03-29 14:47:25 -05:00 committed by GitHub
parent 96e34fe8f7
commit 44497414db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,8 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
e.start_time = std::time(nullptr);
e.duration = duration;
RespawnTimesRepository::ClearInstanceTimers(*this, e.id);
return InstanceListRepository::InsertOne(*this, e).id;
}

View File

@ -77,6 +77,11 @@ public:
return ((r.start + r.duration) - time_seconds);
}
static void ClearInstanceTimers(Database &db, int32_t id)
{
RespawnTimesRepository::DeleteWhere(db, fmt::format("`instance_id` = {}", id));
}
};
#endif //EQEMU_RESPAWN_TIMES_REPOSITORY_H