devilutionX/Source/track.cpp
Robin Eklind d16f603537 all: remove unused storm imports
While no storm functions are called from these source files
it is determined that they included storm in the original
source files as made visible by the inclusion of infinity
in the data segments of the respective source files.

ref: diasurgical/devilution#1695.
2019-09-20 11:05:25 +02:00

51 lines
1 KiB
C++

#include "diablo.h"
DEVILUTION_BEGIN_NAMESPACE
static BYTE sgbIsScrolling;
static DWORD sgdwLastWalk;
static BOOL sgbIsWalking;
void track_process()
{
if (!sgbIsWalking)
return;
if (cursmx < 0 || cursmx >= MAXDUNX - 1 || cursmy < 0 || cursmy >= MAXDUNY - 1)
return;
if (plr[myplr]._pVar8 <= 6 && plr[myplr]._pmode != PM_STAND)
return;
if (cursmx != plr[myplr]._ptargx || cursmy != plr[myplr]._ptargy) {
DWORD tick = GetTickCount();
if ((int)(tick - sgdwLastWalk) >= 300) {
sgdwLastWalk = tick;
NetSendCmdLoc(TRUE, CMD_WALKXY, cursmx, cursmy);
if (!sgbIsScrolling)
sgbIsScrolling = 1;
}
}
}
void track_repeat_walk(BOOL rep)
{
if (sgbIsWalking == rep)
return;
sgbIsWalking = rep;
if (rep) {
sgbIsScrolling = 0;
sgdwLastWalk = GetTickCount() - 50;
NetSendCmdLoc(TRUE, CMD_WALKXY, cursmx, cursmy);
} else if (sgbIsScrolling) {
sgbIsScrolling = 0;
}
}
BOOL track_isscrolling()
{
return sgbIsScrolling;
}
DEVILUTION_END_NAMESPACE