Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Source/multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_timer.h>
#else
#include <SDL.h>

Check warning on line 18 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:18:1 [misc-include-cleaner]

included header SDL.h is not used directly
#endif

#include <config.h>
#include <fmt/format.h>

Check warning on line 22 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:22:1 [misc-include-cleaner]

included header format.h is not used directly

#include "DiabloUI/diabloui.h"
#include "diablo.h"
Expand Down Expand Up @@ -51,23 +51,23 @@

bool gbSomebodyWonGameKludge;
uint16_t sgwPackPlrOffsetTbl[MAX_PLRS];
bool sgbPlayerTurnBitTbl[MAX_PLRS];

Check warning on line 54 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:54:6 [misc-use-internal-linkage]

variable 'sgbPlayerTurnBitTbl' can be made static or moved into an anonymous namespace to enforce internal linkage
bool sgbPlayerLeftGameTbl[MAX_PLRS];

Check warning on line 55 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:55:6 [misc-use-internal-linkage]

variable 'sgbPlayerLeftGameTbl' can be made static or moved into an anonymous namespace to enforce internal linkage
bool shareNextHighPriorityMessage;

Check warning on line 56 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:56:6 [misc-use-internal-linkage]

variable 'shareNextHighPriorityMessage' can be made static or moved into an anonymous namespace to enforce internal linkage
uint8_t gbActivePlayers;
bool gbGameDestroyed;
bool sgbSendDeltaTbl[MAX_PLRS];

Check warning on line 59 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:59:6 [misc-use-internal-linkage]

variable 'sgbSendDeltaTbl' can be made static or moved into an anonymous namespace to enforce internal linkage
GameData sgGameInitInfo;
bool gbSelectProvider;
int sglTimeoutStart;

Check warning on line 62 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:62:5 [misc-use-internal-linkage]

variable 'sglTimeoutStart' can be made static or moved into an anonymous namespace to enforce internal linkage
leaveinfo_t sgdwPlayerLeftReasonTbl[MAX_PLRS];

Check warning on line 63 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:63:13 [misc-use-internal-linkage]

variable 'sgdwPlayerLeftReasonTbl' can be made static or moved into an anonymous namespace to enforce internal linkage
uint32_t sgdwGameLoops;

Check warning on line 64 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:64:10 [misc-use-internal-linkage]

variable 'sgdwGameLoops' can be made static or moved into an anonymous namespace to enforce internal linkage
/**
* Specifies the maximum number of players in a game, where 1
* represents a single player game and 4 represents a multi player game.
*/
bool gbIsMultiplayer;
bool sgbTimeout;

Check warning on line 70 in Source/multi.cpp

View workflow job for this annotation

GitHub Actions / tidy-check

Source/multi.cpp:70:6 [misc-use-internal-linkage]

variable 'sgbTimeout' can be made static or moved into an anonymous namespace to enforce internal linkage
std::string GameName;
std::string GamePassword;
bool PublicGame;
Expand Down Expand Up @@ -726,17 +726,16 @@
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);
Expand Down
Loading