mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
Fix ReloadQuest on Shutdown crash related to encounters
Basically, EntityList::RemoveAllEncounters is called before ReloadQuests resulting in stale pointers in the lua_encounters map. We just have to remove the entry from the map.
This commit is contained in:
@@ -602,6 +602,8 @@ void EntityList::EncounterProcess()
|
||||
auto it = encounter_list.begin();
|
||||
while (it != encounter_list.end()) {
|
||||
if (!it->second->Process()) {
|
||||
// if Process is returning false here, we probably just got called from ReloadQuests .. oh well
|
||||
parse->RemoveEncounter(it->second->GetName());
|
||||
safe_delete(it->second);
|
||||
free_ids.push(it->first);
|
||||
it = encounter_list.erase(it);
|
||||
@@ -2565,6 +2567,7 @@ void EntityList::RemoveAllEncounters()
|
||||
{
|
||||
auto it = encounter_list.begin();
|
||||
while (it != encounter_list.end()) {
|
||||
parse->RemoveEncounter(it->second->GetName());
|
||||
safe_delete(it->second);
|
||||
free_ids.push(it->first);
|
||||
it = encounter_list.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user