Browse Source

Fix bug where remote player on different level writes to dPlayer[][] on the host

pull/8520/head
Johnwill Keating 3 days ago committed by Stephen C. Wills
parent
commit
2e152af0dd
  1. 17
      Source/multi.cpp

17
Source/multi.cpp

@ -726,17 +726,16 @@ void ProcessGameMessagePackets()
player._pBaseMag = pkt->bmag;
player._pBaseDex = pkt->bdex;
const uint8_t rawDir = pkt->pdir;
if (rawDir <= static_cast<uint8_t>(Direction::SouthEast)) {
const Direction newDir = static_cast<Direction>(rawDir);
if (player._pdir != newDir && player._pmode == PM_STAND) {
player._pdir = newDir;
StartStand(player, newDir);
}
}
if (!cond && player.plractive && !player.hasNoLife()) {
if (player.isOnActiveLevel() && !player._pLvlChanging) {
const uint8_t rawDir = pkt->pdir;
if (rawDir <= static_cast<uint8_t>(Direction::SouthEast)) {
const Direction newDir = static_cast<Direction>(rawDir);
if (player._pdir != newDir && player._pmode == PM_STAND) {
player._pdir = newDir;
StartStand(player, newDir);
}
}
if (player.position.tile.WalkingDistance(syncPosition) > 3 && PosOkPlayer(player, syncPosition)) {
// got out of sync, clear the tiles around where we last thought the player was located
FixPlrWalkTags(player);

Loading…
Cancel
Save