crash on irix fix version 2,

version 1, didn't worked at all. bomb.pos wasn't initialized.
origin
stpohle 21 years ago
parent 09575db5dc
commit 8d2c74d791

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.106 2004/12/26 04:19:20 stpohle Exp $ /* $Id: game.c,v 1.107 2005/02/14 20:09:19 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -501,8 +501,8 @@ game_start ()
bman.updatestatusbar=1; bman.updatestatusbar=1;
players[p].frame = 0.0f; players[p].frame = 0.0f;
players[p].d = 0; players[p].d = 0;
players[p].pos.x = -1; players[p].pos.x = 0.0;
players[p].pos.y = -1; players[p].pos.y = 0.0;
players[p].tunnelto = 0.0f; players[p].tunnelto = 0.0f;
players[p].ready = 0; players[p].ready = 0;
@ -520,6 +520,8 @@ game_start ()
players[p].bombs[i].mode = BM_normal; players[p].bombs[i].mode = BM_normal;
players[p].bombs[i].id.p = p; players[p].bombs[i].id.p = p;
players[p].bombs[i].id.b = i; players[p].bombs[i].id.b = i;
players[p].pos.x = 0;
players[p].pos.x = 0;
} }
} }

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.83 2005/01/30 16:53:37 stpohle Exp $ */ /* $Id: single.c,v 1.84 2005/02/14 20:09:19 stpohle Exp $ */
/* single player */ /* single player */
#include "basic.h" #include "basic.h"
@ -7,7 +7,6 @@
#include "player.h" #include "player.h"
#include "single.h" #include "single.h"
/* start a single player game and prepare everything for the game */ /* start a single player game and prepare everything for the game */
void void
single_game_new () single_game_new ()
@ -258,6 +257,12 @@ ai_bombpoints (_point pos, int range)
r; r;
_point p; _point p;
if (pos.x < 0 || pos.x >= MAX_FIELDSIZE_X || pos.y < 0 || pos.y >= MAX_FIELDSIZE_Y) {
printf ("WARNING: ai_bombpoints: pos out of range.\n");
printf (" pos.x=%d pos.y=%d range=%d\n", pos.x, pos.y, range);
return 0;
}
if (map.field[pos.x][pos.y].type != FT_block && map.field[pos.x][pos.y].type != FT_stone if (map.field[pos.x][pos.y].type != FT_block && map.field[pos.x][pos.y].type != FT_stone
&& ai_checkfield (pos.x, pos.y)) { && ai_checkfield (pos.x, pos.y)) {
for (d = 0; d < 4; d++) { for (d = 0; d < 4; d++) {

Loading…
Cancel
Save