Skip to content

Commit 2e152af

Browse files
jwkeatingStephenCWills
authored andcommitted
Fix bug where remote player on different level writes to dPlayer[][] on the host
1 parent 4f6a172 commit 2e152af

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Source/multi.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -726,17 +726,16 @@ void ProcessGameMessagePackets()
726726
player._pBaseMag = pkt->bmag;
727727
player._pBaseDex = pkt->bdex;
728728

729-
const uint8_t rawDir = pkt->pdir;
730-
if (rawDir <= static_cast<uint8_t>(Direction::SouthEast)) {
731-
const Direction newDir = static_cast<Direction>(rawDir);
732-
if (player._pdir != newDir && player._pmode == PM_STAND) {
733-
player._pdir = newDir;
734-
StartStand(player, newDir);
735-
}
736-
}
737-
738729
if (!cond && player.plractive && !player.hasNoLife()) {
739730
if (player.isOnActiveLevel() && !player._pLvlChanging) {
731+
const uint8_t rawDir = pkt->pdir;
732+
if (rawDir <= static_cast<uint8_t>(Direction::SouthEast)) {
733+
const Direction newDir = static_cast<Direction>(rawDir);
734+
if (player._pdir != newDir && player._pmode == PM_STAND) {
735+
player._pdir = newDir;
736+
StartStand(player, newDir);
737+
}
738+
}
740739
if (player.position.tile.WalkingDistance(syncPosition) > 3 && PosOkPlayer(player, syncPosition)) {
741740
// got out of sync, clear the tiles around where we last thought the player was located
742741
FixPlrWalkTags(player);

0 commit comments

Comments
 (0)