From 406b69b88deb4f85cba2e7b27888628735563422 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 8 Jul 2018 00:43:03 +0200 Subject: [PATCH] Walking displays correctly --- src/common/Common.h | 2 +- src/servers/sapphire_zone/Actor/Player.cpp | 3 +-- src/servers/sapphire_zone/Actor/Player.h | 3 --- .../Network/Handlers/PacketHandlers.cpp | 26 ++++++++++--------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index 8088c90b..4036e5da 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -195,7 +195,7 @@ namespace Common { Walking = 0x02, Strafing = 0x04, Jumping = 0x10, - BackWalk = Walking | Strafing, + BackWalk = 0x06, }; enum MoveState : uint8_t diff --git a/src/servers/sapphire_zone/Actor/Player.cpp b/src/servers/sapphire_zone/Actor/Player.cpp index f8df9442..8621da64 100644 --- a/src/servers/sapphire_zone/Actor/Player.cpp +++ b/src/servers/sapphire_zone/Actor/Player.cpp @@ -68,8 +68,7 @@ Core::Entity::Player::Player() : m_markedForRemoval( false ), m_mount( 0 ), m_directorInitialized( false ), - m_onEnterEventDone( false ), - m_bJumping( false ) + m_onEnterEventDone( false ) { m_id = 0; m_currentStance = Stance::Passive; diff --git a/src/servers/sapphire_zone/Actor/Player.h b/src/servers/sapphire_zone/Actor/Player.h index fbfa96fc..a61454ae 100644 --- a/src/servers/sapphire_zone/Actor/Player.h +++ b/src/servers/sapphire_zone/Actor/Player.h @@ -595,13 +595,10 @@ public: /*! checks if a spawn index is valid */ bool isObjSpawnIndexValid( uint8_t index ); - uint64_t m_lastMoveTime; uint8_t m_lastMoveflag; - bool m_bJumping; - private: uint32_t m_lastWrite; uint32_t m_lastPing; diff --git a/src/servers/sapphire_zone/Network/Handlers/PacketHandlers.cpp b/src/servers/sapphire_zone/Network/Handlers/PacketHandlers.cpp index 4e1d36f9..abe7cace 100644 --- a/src/servers/sapphire_zone/Network/Handlers/PacketHandlers.cpp +++ b/src/servers/sapphire_zone/Network/Handlers/PacketHandlers.cpp @@ -191,13 +191,21 @@ void Core::Network::GameConnection::updatePositionHandler( const Core::Network:: //pLog->debug( std::to_string( moveState ) + " -- moveState " ); //pLog->debug( std::to_string( moveType ) + " -- moveType " ); + if( moveType & MoveType::Running ) + { + unk1 = 0x7F; + unk2 = 0x00; + unk4 = 0x3C; + } + if( moveType & MoveType::Strafing ) { unk2 = 0x40; - if( IPC_OP_019A.strafeRight == 1 ) - unk1 = 0xbf; - else - unk1 = 0x5f; + unk1 = 0x7F; + //if( IPC_OP_019A.strafeRight == 1 ) + // unk1 = 0xbf; + //else + // unk1 = 0x5f; unk4 = 0x3C; } @@ -206,22 +214,16 @@ void Core::Network::GameConnection::updatePositionHandler( const Core::Network:: unk1 = 0x7F; unk2 = 0x02; unk3 = 0x00; - unk4 = 0x0518; + unk4 = 0x18; } - if( moveType & MoveType::BackWalk ) + if( moveType & MoveType::Walking && moveType & MoveType::Strafing ) { unk2 = 0x06; unk1 = 0xFF; unk4 = 0x18; } - if( moveType & MoveType::Running ) - { - unk1 = 0x7F; - unk4 = 0x3C; - } - if( moveType & MoveType::Jumping ) {