mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
[Bug Fix] Fix Issue with ClearSpawnTimers() (#4070)
# Notes - We were using the improper ID for this and not checking if the vector was empty before using.
This commit is contained in:
parent
508b37dc93
commit
435b6142b8
@ -2649,22 +2649,24 @@ void Zone::ClearSpawnTimers()
|
||||
|
||||
iterator.Reset();
|
||||
|
||||
std::vector<std::string> respawn_ids;
|
||||
std::vector<uint32> respawn_ids;
|
||||
|
||||
while (iterator.MoreElements()) {
|
||||
respawn_ids.emplace_back(std::to_string(iterator.GetData()->GetID()));
|
||||
respawn_ids.emplace_back(iterator.GetData()->spawn2_id);
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (!respawn_ids.empty()) {
|
||||
RespawnTimesRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`instance_id` = {} AND `id` IN ({})",
|
||||
GetInstanceID(),
|
||||
Strings::Implode(", ", respawn_ids)
|
||||
Strings::Join(respawn_ids, ", ")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user