BadValue SDL Error Message playermove ?

origin
stpohle 23 years ago
parent c69ed0691a
commit 8bf2cf9a9d

@ -12,8 +12,8 @@ draw_player (_player * player)
dest;
int i;
if ((player->pos.x >> 8) < 0 || (player->pos.x >> 8) > bman.fieldsize.x ||
(player->pos.y >> 8) < 0 || (player->pos.y >> 8) > bman.fieldsize.y) {
if ((player->pos.x >> 8) < 0 || (player->pos.x >> 8) >= bman.fieldsize.x ||
(player->pos.y >> 8) < 0 || (player->pos.y >> 8) >= bman.fieldsize.y) {
d_fatal ("Draw Player out of range : [%d,%d]\n", (player->pos.x >> 8),
(player->pos.y >> 8));
return;
@ -88,9 +88,9 @@ restore_players_screen ()
for (i = 0; i < MAX_PLAYERS; i++)
if ((PS_IS_used (bman.players[i].state)) && bman.players[i].old.x != -1) {
if ((bman.players[i].old.x >> 8) < 0 || (bman.players[i].old.x >> 8) > bman.fieldsize.x
if ((bman.players[i].old.x >> 8) < 0 || (bman.players[i].old.x >> 8) >= bman.fieldsize.x
|| (bman.players[i].old.y >> 8) < 0
|| (bman.players[i].old.y >> 8) > bman.fieldsize.y)
|| (bman.players[i].old.y >> 8) >= bman.fieldsize.y)
d_fatal ("Restore Player out of range : playernr %d [%d,%d]\n", i,
(bman.players[i].old.x >> 8), (bman.players[i].old.y >> 8));
else {

Loading…
Cancel
Save