Browse Source

Enum (#340)

* Use MAX_PLRS in player.cpp

* Use WALK_NONE in player.cpp

* CMD_WALKXY
pull/4/head
Anders Jenbo 8 years ago committed by Robin Eklind
parent
commit
5931fbe1f9
  1. 8
      Source/player.cpp
  2. 2
      Source/trigs.cpp

8
Source/player.cpp

@ -797,7 +797,7 @@ void __fastcall AddPlrExperience(int pnum, int lvl, int exp)
void __fastcall AddPlrMonstExper(int lvl, int exp, char pmask)
{
int totplrs = 0;
for (int i = 0; i < 4; i++ ) {
for (int i = 0; i < MAX_PLRS; i++ ) {
if ( (1 << i) & pmask ) {
totplrs++;
}
@ -880,7 +880,7 @@ void __fastcall InitPlayer(int pnum, BOOL FirstTime)
if ( pnum == myplr ) {
plr[pnum]._plid = AddLight(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum]._pLightRad);
} else {
plr[pnum]._plid = -1;
plr[pnum]._plid = WALK_NONE;
}
plr[pnum]._pvid = AddVision(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum]._pLightRad, pnum == myplr);
}
@ -1693,7 +1693,7 @@ void __fastcall StartPlayerKill(int pnum, int earflag)
BOOL diablolevel = gbMaxPlayers > 1 && plr[pnum].plrlevel == 16;
if ( (DWORD)pnum >= 4 ) {
if ( (DWORD)pnum >= MAX_PLRS ) {
TermMsg("StartPlayerKill: illegal player %d", pnum);
}
@ -2111,7 +2111,7 @@ void __fastcall RestartTownLvl(int pnum)
v1 = pnum;
InitLevelChange(pnum);
if ( v1 >= 4 )
if ( v1 >= MAX_PLRS )
TermMsg("RestartTownLvl: illegal player %d", v1);
v2 = v1;
plr[v2].plrlevel = 0;

2
Source/trigs.cpp

@ -1376,7 +1376,7 @@ LABEL_42:
}
_LOBYTE(v2) = error_id;
InitDiabloMsg(v2);
NetSendCmdLoc(1u, 1u, x, y);
NetSendCmdLoc(1u, CMD_WALKXY, x, y);
}
// 679660: using guessed type char gbMaxPlayers;
// 6ABB30: using guessed type int TWarpFrom;

Loading…
Cancel
Save