Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.225 diff -u -r1.225 packhand.c --- client/packhand.c 2002/03/06 03:03:04 1.225 +++ client/packhand.c 2002/03/06 15:52:24 @@ -1505,7 +1505,15 @@ ship->travel_time = p->travel_time; for(i=0; istructure[i] = p->structure[i]-'0'; + if (p->structure[i] == '0') { + ship->structure[i] = FALSE; + } else if (p->structure[i] == '1') { + ship->structure[i] = TRUE; + } else { + freelog(LOG_ERROR, "invalid spaceship structure '%c' %d", + p->structure[i], p->structure[i]); + ship->structure[i] = FALSE; + } } if (pplayer != game.player_ptr) { Index: common/spaceship.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/spaceship.h,v retrieving revision 1.2 diff -u -r1.2 spaceship.h --- common/spaceship.h 2001/12/11 16:16:39 1.2 +++ common/spaceship.h 2002/03/06 15:52:31 @@ -83,7 +83,7 @@ int components; int modules; /* which structurals placed: (array of booleans) */ - char structure[NUM_SS_STRUCTURALS]; + bool structure[NUM_SS_STRUCTURALS]; /* which components and modules placed: (may or may not be connected) */ int fuel; int propulsion; Index: server/savegame.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v retrieving revision 1.69 diff -u -r1.69 savegame.c --- server/savegame.c 2002/03/06 03:03:17 1.69 +++ server/savegame.c 2002/03/06 15:52:34 @@ -693,7 +693,7 @@ ship->fuel = (ship->components + 1)/2; ship->propulsion = ship->components/2; for(i=0; istructurals; i++) { - ship->structure[i] = 1; + ship->structure[i] = TRUE; } spaceship_calc_derived(ship); } @@ -715,9 +715,18 @@ ship->habitation = secfile_lookup_int(file, "%s.habitation", prefix); ship->life_support = secfile_lookup_int(file, "%s.life_support", prefix); ship->solar_panels = secfile_lookup_int(file, "%s.solar_panels", prefix); + st = secfile_lookup_str(file, "%s.structure", prefix); - for(i=0; istructure[i] = ((*st) == '1'); + for (i = 0; i < NUM_SS_STRUCTURALS; i++) { + if (st[i] == '0') { + ship->structure[i] = FALSE; + } else if (st[i] == '1') { + ship->structure[i] = TRUE; + } else { + freelog(LOG_ERROR, "invalid spaceship structure '%c' %d", st[i], + st[i]); + ship->structure[i] = FALSE; + } } if (ship->state >= SSHIP_LAUNCHED) { ship->launch_year = secfile_lookup_int(file, "%s.launch_year", prefix); Index: server/spacerace.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/spacerace.c,v retrieving revision 1.25 diff -u -r1.25 spacerace.c --- server/spacerace.c 2002/02/27 11:12:53 1.25 +++ server/spacerace.c 2002/03/06 15:52:34 @@ -140,7 +140,7 @@ info.travel_time = ship->travel_time; for(j=0; jstructure[j] + '0'; + info.structure[j] = ship->structure[j] ? '1' : '0'; } info.structure[j] = '\0';