Advertisement
sorvani

crashy!

Feb 8th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.46 KB | None | 0 0
  1. index c76e110..11917cf 100644
  2. --- a/zone/spawn2.h
  3. +++ b/zone/spawn2.h
  4. @@ -101,7 +101,8 @@ public:
  5.         DoNothing = 0,
  6.         DoDepop = 1,
  7.         DoRepop = 2,
  8. -       //... 3...9 reserved for future use
  9. +       DoRepopKeepTimer = 3,
  10. +       //... 4...9 reserved for future use
  11.         DoSignalMin = 10    //any number above this value is used as
  12.                             //a base for the signal ID sent. e.g.
  13.                             // value 12 sends signal id 2
  14.  
  15. index c1355b5..e0b5e91 100644
  16. --- a/zone/spawn2.cpp
  17. +++ b/zone/spawn2.cpp
  18. @@ -482,6 +482,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
  19.         return; //no change
  20.     }
  21.  
  22. +   uint32 timer_remaining = timer.GetRemainingTime();
  23.     switch(c.on_change) {
  24.     case SpawnCondition::DoNothing:
  25.         //that was easy.
  26. @@ -499,6 +500,13 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
  27.             npcthis->Depop(false);  //remove the current mob
  28.         Repop();    //repop
  29.         break;
  30. +   case SpawnCondition::DoRepopKeepTimer:
  31. +       _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Preforming a repop.", spawn2_id, new_state?"enabed":"disabled");
  32. +       if(npcthis != nullptr)
  33. +           npcthis->Depop(false);  //remove the current mob
  34. +       if (timer_remaining < 100 ) // if it is < 100 just repop, otherwise respect timer and no repop
  35. +           Repop();
  36. +       break;
  37.     default:
  38.         if(c.on_change < SpawnCondition::DoSignalMin) {
  39.             _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabed":"disabled", c.on_change);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement