if (same(game.state.planets[i].w, game.state.kscmdr) &&
game.state.planets[i].crystals == present) {
/* destroy the planet */
- DESTROY(&game.state.planets[i]);
+ game.state.planets[i].pclass = destroyed;
game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
if (!damaged(DRADIO) || game.condition == docked) {
pause_game(true);
prout(_(" destroyed."));
game.state.nplankl++;
q->planet = NOPLANET;
- DESTROY(&game.state.planets[game.iplnet]);
+ game.state.planets[game.iplnet].pclass = destroyed;
game.iplnet = 0;
invalidate(game.plnet);
game.quad[w.x][w.y] = IHDOT;
prout(_(" destroyed."));
game.state.nworldkl++;
q->planet = NOPLANET;
- DESTROY(&game.state.planets[game.iplnet]);
+ game.state.planets[game.iplnet].pclass = destroyed;
game.iplnet = 0;
invalidate(game.plnet);
game.quad[w.x][w.y] = IHDOT;
game.state.nplankl++;
crmena(true, IHP, sector, scratch);
prout(_(" destroyed."));
- DESTROY(&game.state.planets[game.iplnet]);
+ game.state.planets[game.iplnet].pclass = destroyed;
game.iplnet = 0;
invalidate(game.plnet);
if (game.landed) {
int loop;
for (loop = 0; loop < game.inplan; loop++)
if (same(game.state.planets[loop].w, nq)) {
- DESTROY(&game.state.planets[loop]);
+ game.state.planets[loop].pclass = destroyed;
}
}
/* Destroy any base in supernovaed quadrant */
prout(_("Spock- \"Planet report follows, Captain.\""));
skip(1);
for (i = 0; i < game.inplan; i++) {
+ if (game.state.planets[i].pclass == destroyed)
+ continue;
if ((game.state.planets[i].known != unknown
- && game.state.planets[i].inhabited == UNINHABITED)
- || (idebug && game.state.planets[i].w.x !=0)
- ) {
+ && game.state.planets[i].inhabited == UNINHABITED)
+ || idebug) {
iknow = true;
if (idebug && game.state.planets[i].known==unknown)
proutn("(Unknown) ");
typedef struct {
coord w;
- enum {M=0, N=1, O=2} pclass;
+ enum {destroyed= -1, M=0, N=1, O=2} pclass;
int inhabited; /* if NZ, an index into a name array */
#define UNINHABITED -1
enum {mined=-1, present=0, absent=1} crystals; /* has crystals */
enum {unknown, known, shuttle_down} known;
} planet;
-#define DESTROY(pl) memset(pl, '\0', sizeof(planet))
-
typedef enum {
IHR = 'R',
IHK = 'K',