[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

@ -289,6 +289,13 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
if(!obj)
return;
// Additional check preventing exploits (ie loot despawned chests)
if (!obj->isSpawned())
{
sLog.outError("HandleGameObjectUseOpcode: CMSG_GAMEOBJ_USE for despawned GameObject (Entry %u), didn't expect this to happen.", obj->GetEntry());
return;
}
// Never expect this opcode for some type GO's
if (obj->GetGoType() == GAMEOBJECT_TYPE_GENERIC)
{
@ -296,6 +303,13 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
return;
}
// Never expect this opcode for non intractable GO's
if (obj->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT))
{
sLog.outError("HandleGameObjectUseOpcode: CMSG_GAMEOBJ_USE for GameObject (Entry %u) with non intractable flag (Flags %u), didn't expect this to happen.", obj->GetEntry(), obj->GetUInt32Value(GAMEOBJECT_FLAGS));
return;
}
obj->Use(_player);
}