mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
4a087e6bda
commit
0de4e302b3
8 changed files with 98 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue