mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +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();
|
iterator.Reset();
|
||||||
|
|
||||||
std::vector<std::string> respawn_ids;
|
std::vector<uint32> respawn_ids;
|
||||||
|
|
||||||
while (iterator.MoreElements()) {
|
while (iterator.MoreElements()) {
|
||||||
respawn_ids.emplace_back(std::to_string(iterator.GetData()->GetID()));
|
respawn_ids.emplace_back(iterator.GetData()->spawn2_id);
|
||||||
|
|
||||||
iterator.Advance();
|
iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
RespawnTimesRepository::DeleteWhere(
|
if (!respawn_ids.empty()) {
|
||||||
database,
|
RespawnTimesRepository::DeleteWhere(
|
||||||
fmt::format(
|
database,
|
||||||
"`instance_id` = {} AND `id` IN ({})",
|
fmt::format(
|
||||||
GetInstanceID(),
|
"`instance_id` = {} AND `id` IN ({})",
|
||||||
Strings::Implode(", ", respawn_ids)
|
GetInstanceID(),
|
||||||
)
|
Strings::Join(respawn_ids, ", ")
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user