[11558] Fixes and way work chnages for GO lock/interact state

* Not reset lock/interact state in instances (so until instance reset)
* Do unti-cheating checks for use attempts locked/non-intareactive GOs
* Implement SCRIPT_COMMAND_GO_LOCK_STATE for control lock/interact state of GOs from scripts.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2011-05-29 04:25:50 +04:00 committed by VladimirMangos
parent 4a087e6bda
commit 0de4e302b3
8 changed files with 98 additions and 10 deletions

View file

@ -398,8 +398,11 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0)
{
SendObjectDeSpawnAnim(GetObjectGuid());
//reset flags
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
// reset flags: In Instances do not restore GO_FLAG_LOCKED or GO_FLAG_NO_INTERACT
if (GetMap()->Instanceable())
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags & ~(GO_FLAG_LOCKED | GO_FLAG_NO_INTERACT));
else
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
}
loot.clear();