Core/GameObjects: Implement support for HandleGameObjectUse from vehicle or mount

This commit is contained in:
Trista committed 2013-03-09 05:24:33 +02:00
1 parent 83c98d6dff
commit ed378ad63c
2 files changed
+23 -8

No files matched your search

+7 -4
View File
@@ -271,12 +271,15 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
// ignore for remote control state
if (_player->m_mover != _player)
return;
if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid))
{
// ignore for remote control state
if (_player->m_mover != _player)
if (!_player->IsOnVehicle(_player->m_mover) || !_player->IsMounted() && !obj->GetGOInfo()->IsUsableMounted())
return;
obj->Use(_player);
}
}
void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)