Skip to content

Commit

Permalink
Fix buffer overrun bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Pharap committed Oct 9, 2022
1 parent aa2c591 commit 340ef29
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Creapawn/pawnconstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ void PawnConstruct()
if (pawn[i][1] > 15)
PawnStatConstruct( pawn[i][1], pawn[i][0], i);
if (i < 4)
{
pawnXPosition[i] = 64;
pawnYPosition[i] = i * 16;
pawnDirection[i] = right;
pawnBoardLocation[pawnXPosition[i] / 16][0] = i;
}
else
{
pawnXPosition[i] = 112;
pawnYPosition[i] = (i - 4) * 16;
pawnDirection[i] = left;
pawnBoardLocation[pawnXPosition[i] / 16][3] = i;
}
{
pawnXPosition[i] = 64;
pawnYPosition[i] = i * 16;
pawnDirection[i] = right;
pawnBoardLocation[i][0] = i;
}
else
{
pawnXPosition[i] = 112;
pawnYPosition[i] = (i - 4) * 16;
pawnDirection[i] = left;
pawnBoardLocation[i - 4][3] = i;
}
}

}

0 comments on commit 340ef29

Please sign in to comment.