From a0852287ace3ebb5bf8c78ec258caea76e12fcd4 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Fri, 3 Jun 2011 12:33:28 +0400 Subject: [PATCH] [11592] More proper way exclude GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT from reset in instances. Signed-off-by: VladimirMangos --- src/game/GameObject.cpp | 8 ++++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index d1907431f..f3bde11d6 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -398,9 +398,13 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0) { SendObjectDeSpawnAnim(GetObjectGuid()); - // reset flags: In Instances do not restore GO_FLAG_LOCKED or GO_FLAG_NO_INTERACT + // reset flags if (GetMap()->Instanceable()) - SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags & ~(GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT)); + { + // In Instances GO_FLAG_LOCKED or GO_FLAG_NO_INTERACT are not changed + uint32 currentLockOrInteractFlags = GetUInt32Value(GAMEOBJECT_FLAGS) & (GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT); + SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags & ~(GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT) | currentLockOrInteractFlags); + } else SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6e918217f..4cb14d807 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11591" + #define REVISION_NR "11592" #endif // __REVISION_NR_H__