[11592] More proper way exclude GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT from reset in instances.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2011-06-03 12:33:28 +04:00 committed by VladimirMangos
parent 02cbb905fa
commit a0852287ac
2 changed files with 7 additions and 3 deletions

View file

@ -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);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11591"
#define REVISION_NR "11592"
#endif // __REVISION_NR_H__