Update position before sending cell packet

This commit is contained in:
David Cernat 2016-09-26 17:00:09 +03:00
parent 1ee2458f6e
commit 01af4f3bbc
2 changed files with 3 additions and 3 deletions

View file

@ -86,7 +86,6 @@ const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->GetCell()->mName.c_str(); return player->GetCell()->mName.c_str();
} }

View file

@ -439,11 +439,12 @@ void LocalPlayer::updateCell(bool forceUpdate)
(*GetCell()) = *_cell; (*GetCell()) = *_cell;
isExterior = _cell->isExterior(); isExterior = _cell->isExterior();
// Make sure the position is updated before a cell packet is sent
updatePosition(true);
RakNet::BitStream bs; RakNet::BitStream bs;
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true); GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true);
GetNetworking()->SendData(&bs); GetNetworking()->SendData(&bs);
updatePosition(true);
} }
} }