mirror of
https://github.com/edubart/otclient.git
synced 2025-12-25 01:07:12 +01:00
creature walk, fps fix (map duplicate items fix with clean), some protocol parses
This commit is contained in:
@@ -42,3 +42,49 @@ void Game::onLogout()
|
||||
m_localPlayer.reset();
|
||||
m_online = false;
|
||||
}
|
||||
|
||||
void Game::walk(Direction direction)
|
||||
{
|
||||
if(!m_online)
|
||||
return;
|
||||
|
||||
// TODO: check if we can walk.
|
||||
|
||||
m_localPlayer->setDirection(direction);
|
||||
|
||||
switch(direction) {
|
||||
case DIRECTION_NORTH:
|
||||
m_protocolGame->sendWalkNorth();
|
||||
break;
|
||||
case DIRECTION_EAST:
|
||||
m_protocolGame->sendWalkEast();
|
||||
break;
|
||||
case DIRECTION_SOUTH:
|
||||
m_protocolGame->sendWalkSouth();
|
||||
break;
|
||||
case DIRECTION_WEST:
|
||||
m_protocolGame->sendWalkWest();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Game::turn(Direction direction)
|
||||
{
|
||||
if(!m_online)
|
||||
return;
|
||||
|
||||
switch(direction) {
|
||||
case DIRECTION_NORTH:
|
||||
m_protocolGame->sendTurnNorth();
|
||||
break;
|
||||
case DIRECTION_EAST:
|
||||
m_protocolGame->sendTurnEast();
|
||||
break;
|
||||
case DIRECTION_SOUTH:
|
||||
m_protocolGame->sendTurnSouth();
|
||||
break;
|
||||
case DIRECTION_WEST:
|
||||
m_protocolGame->sendTurnWest();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user