Advertisement
sorvani

extra check for spawn condition

Feb 9th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.07 KB | None | 0 0
  1. diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp
  2. index 4887ed6..30f8999 100644
  3. --- a/zone/spawn2.cpp
  4. +++ b/zone/spawn2.cpp
  5. @@ -502,8 +502,11 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
  6.         break;
  7.     case SpawnCondition::DoRepopIfReady:
  8.         _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled");
  9. -       if(npcthis != nullptr)
  10. +       if(npcthis != nullptr) {
  11. +           _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName());
  12.             npcthis->Depop(false);  //remove the current mob
  13. +           npcthis = nullptr;
  14. +       }
  15.         if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
  16.             timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID());
  17.             _log(SPAWNS__CONDITIONS,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement