Browse Source

Apply MAX_PATH_LENGTH

pull/570/head
qndel 6 years ago committed by GitHub
parent
commit
cc6a2d4523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Source/loadsave.cpp
  2. 2
      SourceX/controls/plrctrls.cpp

4
Source/loadsave.cpp

@ -271,7 +271,7 @@ void LoadPlayer(int i)
PlayerStruct *pPlayer = &plr[i];
CopyInt(tbuff, &pPlayer->_pmode);
CopyBytes(tbuff, 25, pPlayer->walkpath);
CopyBytes(tbuff, MAX_PATH_LENGTH, pPlayer->walkpath);
CopyBytes(tbuff, 1, &pPlayer->plractive);
tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->destAction);
@ -996,7 +996,7 @@ void SavePlayer(int i)
PlayerStruct *pPlayer = &plr[i];
CopyInt(&pPlayer->_pmode, tbuff);
CopyBytes(&pPlayer->walkpath, 25, tbuff);
CopyBytes(&pPlayer->walkpath, MAX_PATH_LENGTH, tbuff);
CopyBytes(&pPlayer->plractive, 1, tbuff);
tbuff += 2; // Alignment
CopyInt(&pPlayer->destAction, tbuff);

2
SourceX/controls/plrctrls.cpp

@ -80,7 +80,7 @@ int GetDistance(int dx, int dy, int maxDistance)
return 0;
}
char walkpath[25];
char walkpath[MAX_PATH_LENGTH];
int steps = FindPath(PosOkPlayer, myplr, plr[myplr]._px, plr[myplr]._py, dx, dy, walkpath);
if (steps > maxDistance)
return 0;

Loading…
Cancel
Save