? out ? err ? game.log ? civscore.log ? 1 ? extra_assert.diff Index: server/gotohand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/gotohand.c,v retrieving revision 1.118 diff -u -r1.118 gotohand.c --- server/gotohand.c 2001/09/19 19:09:18 1.118 +++ server/gotohand.c 2001/09/22 20:45:05 @@ -528,6 +528,8 @@ x = map_adjust_x(src_x + DIR_DX[dir]); y = map_adjust_y(src_y + DIR_DY[dir]); + assert(is_real_tile(x,y)); + if (!dir_ok(dest_x, dest_y, punit->goto_dest_x, punit->goto_dest_y, dir)) continue; if ((map_get_terrain(x, y) != T_OCEAN) @@ -938,6 +940,7 @@ if (unit_flag(punit, F_IGTER) && c) c = 1; x = map_adjust_x(punit->x + DIR_DX[k]); y = map_adjust_y(punit->y + DIR_DY[k]); + assert(is_real_tile(x, y)); if (passenger) { freelog(LOG_DEBUG, "%d@(%d,%d) evaluating (%d,%d)[%d/%d]", punit->id, punit->x, punit->y, x, y, c, punit->moves_left); @@ -976,6 +979,7 @@ nearland = 0; if (!pplayer->ai.control && !map_get_known(x, y, pplayer)) nearland++; for (n = 0; n < 8; n++) { + assert(is_real_tile(x + DIR_DX[n], y + DIR_DY[n])); adjtile = map_get_tile(x + DIR_DX[n], y + DIR_DY[n]); if (adjtile->terrain != T_OCEAN) nearland++; if (!((adjtile->known)&(1u<owner))) { @@ -999,6 +1003,7 @@ else if (punit->moves_left == 6) { for (n = 0; n < 8; n++) { if ((warmap.vector[x][y]&(1< 0) { for (k = 0; k < 8; k++) { + assert(is_real_tile(x + DIR_DX[k], y + DIR_DY[k])); if (map_get_continent(punit->x, punit->y) == map_get_continent(x + DIR_DX[k], y + DIR_DY[k])) possible++; @@ -1053,6 +1059,7 @@ possible++; else { for (k = 0; k < 8; k++) { + assert(is_real_tile(punit->x + DIR_DX[k], punit->y + DIR_DY[k])); if (map_get_continent(punit->x + DIR_DX[k], punit->y + DIR_DY[k]) == map_get_continent(x, y)) possible++; @@ -1148,6 +1155,7 @@ freelog(LOG_DEBUG, "Going %s", dir_get_name(dir)); x = map_adjust_x(punit->x + DIR_DX[dir]); y = punit->y + DIR_DY[dir]; /* no need to adjust this */ + assert(is_real_tile(x, y)); penemy = is_enemy_unit_tile(map_get_tile(x, y), unit_owner(punit)); if (!punit->moves_left)