forked from teamnwah/openmw-tes3coop
Update position before sending cell packet
This commit is contained in:
parent
1ee2458f6e
commit
01af4f3bbc
2 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue