Browse Source

Consistant variable comparisons

pull/4823/head
Anders Jenbo 4 years ago
parent
commit
bf47c95fe6
  1. 2
      Source/monster.cpp
  2. 2
      Source/msg.cpp
  3. 4
      Source/multi.cpp

2
Source/monster.cpp

@ -3982,7 +3982,7 @@ void M_StartKill(int monsterId, int pnum)
assert(monsterId >= 0 && monsterId < MAXMONSTERS);
auto &monster = Monsters[monsterId];
if (MyPlayerId == pnum) {
if (pnum == MyPlayerId) {
delta_kill_monster(monsterId, monster.position.tile, *MyPlayer);
if (monsterId != pnum) {
NetSendCmdLocParam1(false, CMD_MONSTDEATH, monster.position.tile, monsterId);

2
Source/msg.cpp

@ -1824,7 +1824,7 @@ DWORD OnPlayerJoinLevel(const TCmd *pCmd, int pnum)
EventPlrMsg(fmt::format(fmt::runtime(_("Player '{:s}' (level {:d}) just joined the game")), player._pName, player._pLevel));
}
if (player.plractive && MyPlayerId != pnum) {
if (player.plractive && pnum != MyPlayerId) {
player.position.tile = position;
if (isSetLevel)
player.setLevel(static_cast<_setlevels>(playerLevel));

4
Source/multi.cpp

@ -206,7 +206,7 @@ void HandleTurnUpperBit(int pnum)
if (MyPlayerId == i) {
sgbSendDeltaTbl[pnum] = true;
} else if (MyPlayerId == pnum) {
} else if (pnum == MyPlayerId) {
gbDeltaSender = i;
}
}
@ -785,7 +785,7 @@ void recv_plrinfo(int pnum, const TCmdPlrInfoHdr &header, bool recv)
{
static PlayerPack PackedPlayerBuffer[MAX_PLRS];
if (MyPlayerId == pnum) {
if (pnum == MyPlayerId) {
return;
}
assert(pnum >= 0 && pnum < MAX_PLRS);

Loading…
Cancel
Save