mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Crash] Fix spawn race condition shown by #repop (#2455)
* Troubleshooting * Debugging * Debugging * Debugging * Debugging * Remove debug line * Revert back to GetRawNPCTypeName
This commit is contained in:
parent
74dfc1ae3c
commit
714fb032e9
@ -4257,10 +4257,12 @@ bool EntityList::LimitCheckName(const char *npc_name)
|
|||||||
{
|
{
|
||||||
auto it = npc_list.begin();
|
auto it = npc_list.begin();
|
||||||
while (it != npc_list.end()) {
|
while (it != npc_list.end()) {
|
||||||
NPC* npc = it->second;
|
NPC *npc = it->second;
|
||||||
if (npc)
|
if (npc) {
|
||||||
if (strcasecmp(npc_name, npc->GetRawNPCTypeName()) == 0)
|
if (strcasecmp(npc_name, npc->GetRawNPCTypeName()) == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -4,9 +4,9 @@ void command_repop(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
int arguments = sep->argnum;
|
int arguments = sep->argnum;
|
||||||
if (!arguments) {
|
if (!arguments) {
|
||||||
|
entity_list.ClearAreas();
|
||||||
c->Message(Chat::White, "Zone depopped, repopping now.");
|
c->Message(Chat::White, "Zone depopped, repopping now.");
|
||||||
zone->Repop();
|
zone->Repop();
|
||||||
zone->spawn2_timer.Trigger();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15,11 +15,10 @@ void command_repop(Client *c, const Seperator *sep)
|
|||||||
if (is_force) {
|
if (is_force) {
|
||||||
zone->ClearSpawnTimers();
|
zone->ClearSpawnTimers();
|
||||||
c->Message(Chat::White, "Zone depopped, forcefully repopping now.");
|
c->Message(Chat::White, "Zone depopped, forcefully repopping now.");
|
||||||
} else {
|
} else {
|
||||||
c->Message(Chat::White, "Zone depopped, repopping now.");
|
c->Message(Chat::White, "Zone depopped, repopping now.");
|
||||||
}
|
}
|
||||||
|
|
||||||
zone->Repop();
|
zone->Repop();
|
||||||
zone->spawn2_timer.Trigger();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -205,6 +205,11 @@ bool Spawn2::Process() {
|
|||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tmp->npc_id == 0) {
|
||||||
|
LogError("NPC type did not load for npc_id [{}]", npcid);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (tmp->unique_spawn_by_name) {
|
if (tmp->unique_spawn_by_name) {
|
||||||
if (!entity_list.LimitCheckName(tmp->name)) {
|
if (!entity_list.LimitCheckName(tmp->name)) {
|
||||||
LogSpawns("Spawn2 [{}]: Spawn group [{}] yeilded NPC type [{}], which is unique and one already exists", spawn2_id, spawngroup_id_, npcid);
|
LogSpawns("Spawn2 [{}]: Spawn group [{}] yeilded NPC type [{}], which is unique and one already exists", spawn2_id, spawngroup_id_, npcid);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user