mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +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() {
|
||||
timer.Start(resetTimer());
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
LogSpawns("Spawn2 [{}]: Spawn reset, repop in [{}] ms", spawn2_id, timer.GetRemainingTime());
|
||||
}
|
||||
|
||||
@ -363,6 +364,7 @@ void Spawn2::Depop() {
|
||||
timer.Disable();
|
||||
LogSpawns("Spawn2 [{}]: Spawn reset, repop disabled", spawn2_id);
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
}
|
||||
|
||||
void Spawn2::Repop(uint32 delay) {
|
||||
@ -374,6 +376,7 @@ void Spawn2::Repop(uint32 delay) {
|
||||
timer.Start(delay);
|
||||
}
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
}
|
||||
|
||||
void Spawn2::ForceDespawn()
|
||||
@ -392,12 +395,14 @@ void Spawn2::ForceDespawn()
|
||||
npcthis->Depop(true);
|
||||
IsDespawned = true;
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
npcthis->Depop(false);
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -429,6 +434,7 @@ void Spawn2::DeathReset(bool realdeath)
|
||||
|
||||
//zero out our NPC since he is now gone
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
|
||||
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());
|
||||
npcthis->Depop(false); //remove the current mob
|
||||
npcthis = nullptr;
|
||||
currentnpcid = 0;
|
||||
}
|
||||
if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
|
||||
timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user