diff options
author | Supabad <supabad.trinity@gmail.com> | 2011-04-08 18:33:13 +0200 |
---|---|---|
committer | Supabad <supabad.trinity@gmail.com> | 2011-04-08 18:33:13 +0200 |
commit | 5f4337f7e9e11b7992a39a88969ba9f4502d00dc (patch) | |
tree | a09dfaad45df6e435982ba3aa9d5e0b397351fb6 | |
parent | 1e94fc530b5cdf7c6e5f6a24018efec4842f72d9 (diff) |
Core/GameObjects: traps that dont have a owner should despawn after spell cast.
-rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index ed5442442fe..c071e2aa489 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -278,7 +278,7 @@ void GameObject::Update(uint32 diff) // Arming Time for GAMEOBJECT_TYPE_TRAP (6) GameObjectInfo const* goInfo = GetGOInfo(); // Bombs - if (goInfo->trap.charges == 2) + if (goInfo->trap.type == 2) m_cooldownTime = time(NULL) + 10; // Hardcoded tooltip value else if (Unit* owner = GetOwner()) { @@ -393,7 +393,7 @@ void GameObject::Update(uint32 diff) return; // Type 2 - Bomb (will go away after casting it's spell) - if (goInfo->trap.charges == 2) + if (goInfo->trap.type == 2) { if (goInfo->trap.spellId) CastSpell(NULL, goInfo->trap.spellId); // FIXME: null target won't work for target type 1 @@ -453,7 +453,7 @@ void GameObject::Update(uint32 diff) m_cooldownTime = time(NULL) + goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4); // template or 4 seconds - if (owner) // || goInfo->trap.charges == 1) + if (goInfo->trap.type == 1) SetLootState(GO_JUST_DEACTIVATED); if (IsBattlegroundTrap && ok->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 604a3c8ba55..f01d7c673af 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -130,7 +130,7 @@ struct GameObjectInfo uint32 level; //1 uint32 radius; //2 radius for trap activation uint32 spellId; //3 - uint32 charges; //4 need respawn (if > 0) + uint32 type; //4 0 trap with no despawn after cast. 1 trap despawns after cast. 2 bomb casts on spawn. uint32 cooldown; //5 time in secs int32 autoCloseTime; //6 uint32 startDelay; //7 |