Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.66 KB | None | 0 0
  1. diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
  2. index b2d88630aeb5..2e0e76119664 100644
  3. --- a/src/server/game/Entities/GameObject/GameObject.cpp
  4. +++ b/src/server/game/Entities/GameObject/GameObject.cpp
  5. @@ -755,7 +755,8 @@ void GameObject::Update(uint32 diff)
  6.                      m_usetimes = 0;
  7.                  }
  8.  
  9. -                SetGoState(GO_STATE_READY);
  10. +                if (GetGOInfo()->GetLockId() || GetGOInfo()->GetAutoCloseTime())
  11. +                    SetGoState(GO_STATE_READY);
  12.  
  13.                  //any return here in case battleground traps
  14.                  if (GameObjectOverride const* goOverride = GetGameObjectOverride())
  15. @@ -765,23 +766,19 @@ void GameObject::Update(uint32 diff)
  16.  
  17.              loot.clear();
  18.  
  19. -            //! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell
  20. -            //! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
  21. -            if (GetSpellId() || GetOwnerGUID())
  22. +            //Don't delete chests and goobers that have the flag consumable=0
  23. +            if (!GetGOInfo()->IsDespawnAtAction())
  24.              {
  25. -                //Don't delete spell spawned chests, which are not consumed on loot
  26. -                if (m_respawnTime > 0 && GetGoType() == GAMEOBJECT_TYPE_CHEST && !GetGOInfo()->IsDespawnAtAction())
  27. -                {
  28. -                    UpdateObjectVisibility();
  29. -                    SetLootState(GO_READY);
  30. -                }
  31. -                else
  32. -                {
  33. -                    SetRespawnTime(0);
  34. -                    Delete();
  35. -                }
  36. -                return;
  37. +                UpdateObjectVisibility();
  38. +                SetLootState(GO_READY);
  39.              }
  40. +            else
  41. +            {
  42. +                SetRespawnTime(0);
  43. +                Delete();
  44. +            }
  45. +            return;
  46. +        
  47.  
  48.              SetLootState(GO_NOT_READY);
  49.  
  50. @@ -1047,13 +1044,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
  51.      {
  52.          m_spawnedByDefault = true;
  53.  
  54. -        if (!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
  55. -        {
  56. -            SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
  57. -            m_respawnDelayTime = 0;
  58. -            m_respawnTime = 0;
  59. -        }
  60. -        else
  61. +        if (GetGOInfo()->IsDespawnAtAction())
  62.          {
  63.              m_respawnDelayTime = data->spawntimesecs;
  64.              m_respawnTime = GetMap()->GetGORespawnTime(m_spawnId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement