File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -356,13 +356,15 @@ void Spawn2::LoadGrid(int start_wp) {
356
356
void Spawn2::Reset () {
357
357
timer.Start (resetTimer ());
358
358
npcthis = nullptr ;
359
+ currentnpcid = 0 ;
359
360
LogSpawns (" Spawn2 [{}]: Spawn reset, repop in [{}] ms" , spawn2_id, timer.GetRemainingTime ());
360
361
}
361
362
362
363
void Spawn2::Depop () {
363
364
timer.Disable ();
364
365
LogSpawns (" Spawn2 [{}]: Spawn reset, repop disabled" , spawn2_id);
365
366
npcthis = nullptr ;
367
+ currentnpcid = 0 ;
366
368
}
367
369
368
370
void Spawn2::Repop (uint32 delay) {
@@ -374,6 +376,7 @@ void Spawn2::Repop(uint32 delay) {
374
376
timer.Start (delay);
375
377
}
376
378
npcthis = nullptr ;
379
+ currentnpcid = 0 ;
377
380
}
378
381
379
382
void Spawn2::ForceDespawn ()
@@ -392,12 +395,14 @@ void Spawn2::ForceDespawn()
392
395
npcthis->Depop (true );
393
396
IsDespawned = true ;
394
397
npcthis = nullptr ;
398
+ currentnpcid = 0 ;
395
399
return ;
396
400
}
397
401
else
398
402
{
399
403
npcthis->Depop (false );
400
404
npcthis = nullptr ;
405
+ currentnpcid = 0 ;
401
406
}
402
407
}
403
408
}
@@ -429,6 +434,7 @@ void Spawn2::DeathReset(bool realdeath)
429
434
430
435
// zero out our NPC since he is now gone
431
436
npcthis = nullptr ;
437
+ currentnpcid = 0 ;
432
438
433
439
if (realdeath) { killcount++; }
434
440
@@ -643,6 +649,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
643
649
LogSpawns (" Spawn2 [{}]: Our npcthis is currently not null. The zone thinks it is [{}]. Forcing a depop" , spawn2_id, npcthis->GetName ());
644
650
npcthis->Depop (false ); // remove the current mob
645
651
npcthis = nullptr ;
652
+ currentnpcid = 0 ;
646
653
}
647
654
if (new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
648
655
timer_remaining = database.GetSpawnTimeLeft (spawn2_id,zone->GetInstanceID ());
You can’t perform that action at this time.
0 commit comments