mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Bug Fix] Zero out currentnpcid whenever spawn is reset. (#4763)
This commit is contained in:
parent
c33ac40567
commit
a2ed6be1f5
@ -356,6 +356,7 @@ void Spawn2::LoadGrid(int start_wp) {
|
|||||||
void Spawn2::Reset() {
|
void Spawn2::Reset() {
|
||||||
timer.Start(resetTimer());
|
timer.Start(resetTimer());
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
LogSpawns("Spawn2 [{}]: Spawn reset, repop in [{}] ms", spawn2_id, timer.GetRemainingTime());
|
LogSpawns("Spawn2 [{}]: Spawn reset, repop in [{}] ms", spawn2_id, timer.GetRemainingTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,6 +364,7 @@ void Spawn2::Depop() {
|
|||||||
timer.Disable();
|
timer.Disable();
|
||||||
LogSpawns("Spawn2 [{}]: Spawn reset, repop disabled", spawn2_id);
|
LogSpawns("Spawn2 [{}]: Spawn reset, repop disabled", spawn2_id);
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spawn2::Repop(uint32 delay) {
|
void Spawn2::Repop(uint32 delay) {
|
||||||
@ -374,6 +376,7 @@ void Spawn2::Repop(uint32 delay) {
|
|||||||
timer.Start(delay);
|
timer.Start(delay);
|
||||||
}
|
}
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spawn2::ForceDespawn()
|
void Spawn2::ForceDespawn()
|
||||||
@ -392,12 +395,14 @@ void Spawn2::ForceDespawn()
|
|||||||
npcthis->Depop(true);
|
npcthis->Depop(true);
|
||||||
IsDespawned = true;
|
IsDespawned = true;
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
npcthis->Depop(false);
|
npcthis->Depop(false);
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,6 +434,7 @@ void Spawn2::DeathReset(bool realdeath)
|
|||||||
|
|
||||||
//zero out our NPC since he is now gone
|
//zero out our NPC since he is now gone
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
|
|
||||||
if(realdeath) { killcount++; }
|
if(realdeath) { killcount++; }
|
||||||
|
|
||||||
@ -643,6 +649,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
|
|||||||
LogSpawns("Spawn2 [{}]: Our npcthis is currently not null. The zone thinks it is [{}]. Forcing a depop", spawn2_id, npcthis->GetName());
|
LogSpawns("Spawn2 [{}]: Our npcthis is currently not null. The zone thinks it is [{}]. Forcing a depop", spawn2_id, npcthis->GetName());
|
||||||
npcthis->Depop(false); //remove the current mob
|
npcthis->Depop(false); //remove the current mob
|
||||||
npcthis = nullptr;
|
npcthis = nullptr;
|
||||||
|
currentnpcid = 0;
|
||||||
}
|
}
|
||||||
if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
|
if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
|
||||||
timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID());
|
timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user