mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[12109] Add file to handle vehicle related opcodes
Also fixed a stupid typo from recent commit. Thx to dbauz for pointing Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
56674de682
commit
0c752dbdbd
7 changed files with 56 additions and 21 deletions
|
|
@ -401,24 +401,6 @@ void WorldSession::HandleMoveNotActiveMoverOpcode(WorldPacket& recv_data)
|
|||
_player->m_movementInfo = mi;
|
||||
}
|
||||
|
||||
void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
|
||||
recv_data.hexlike();
|
||||
|
||||
ObjectGuid guid;
|
||||
MovementInfo mi;
|
||||
|
||||
recv_data >> guid.ReadAsPacked();
|
||||
recv_data >> mi;
|
||||
|
||||
ObjectGuid vehicleGUID = _player->GetCharmGuid();
|
||||
if (!vehicleGUID) // something wrong here...
|
||||
return;
|
||||
|
||||
_player->m_movementInfo = mi;
|
||||
}
|
||||
|
||||
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
|
||||
{
|
||||
// DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
|
||||
|
|
|
|||
|
|
@ -4330,7 +4330,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
|
|||
|
||||
void Player::SetRoot(bool enable)
|
||||
{
|
||||
WorldPacket data(enable ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, GetPackGUID().size() + 4));
|
||||
WorldPacket data(enable ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, GetPackGUID().size() + 4);
|
||||
data << GetPackGUID();
|
||||
data << uint32(0);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
|
@ -4338,7 +4338,7 @@ void Player::SetRoot(bool enable)
|
|||
|
||||
void Player::SetWaterWalk(bool enable)
|
||||
{
|
||||
WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4));
|
||||
WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4);
|
||||
data << GetPackGUID();
|
||||
data << uint32(0);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
|
|
|||
45
src/game/VehicleHandler.cpp
Normal file
45
src/game/VehicleHandler.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Opcodes.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Log.h"
|
||||
#include "Player.h"
|
||||
#include "Vehicle.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
|
||||
recv_data.hexlike();
|
||||
|
||||
ObjectGuid guid;
|
||||
MovementInfo mi;
|
||||
|
||||
recv_data >> guid.ReadAsPacked();
|
||||
recv_data >> mi;
|
||||
|
||||
ObjectGuid vehicleGUID = _player->GetCharmGuid();
|
||||
if (!vehicleGUID) // something wrong here...
|
||||
return;
|
||||
|
||||
_player->m_movementInfo = mi;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "0154"
|
||||
#define REVISION_NR "12109"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -500,6 +500,7 @@
|
|||
<ClCompile Include="..\..\src\game\Unit.cpp" />
|
||||
<ClCompile Include="..\..\src\game\UpdateData.cpp" />
|
||||
<ClCompile Include="..\..\src\game\Vehicle.cpp" />
|
||||
<ClCompile Include="..\..\src\game\VehicleHandler.cpp" />
|
||||
<ClCompile Include="..\..\src\game\VoiceChatHandler.cpp" />
|
||||
<ClCompile Include="..\..\src\game\WaypointManager.cpp" />
|
||||
<ClCompile Include="..\..\src\game\WaypointMovementGenerator.cpp" />
|
||||
|
|
|
|||
|
|
@ -249,6 +249,9 @@
|
|||
<ClCompile Include="..\..\src\game\UpdateData.cpp">
|
||||
<Filter>World/Handlers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\game\VehicleHandler.cpp">
|
||||
<Filter>World/Handlers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\game\VoiceChatHandler.cpp">
|
||||
<Filter>World/Handlers</Filter>
|
||||
</ClCompile>
|
||||
|
|
|
|||
|
|
@ -1034,6 +1034,10 @@
|
|||
RelativePath="..\..\src\game\UpdateData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\VehicleHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\VoiceChatHandler.cpp"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue