diff server/cityhand.c server/cityhand.c --- server/cityhand.c Mon Jan 1 15:59:11 2001 +++ server/cityhand.c Mon Jan 8 07:48:20 2001 @@ -42,6 +42,7 @@ #include "plrhand.h" #include "sernet.h" #include "settlers.h" +#include "spacerace.h" #include "srv_main.h" #include "unitfunc.h" #include "unithand.h" @@ -405,6 +406,7 @@ if (!is_wonder(id)) { pcity->improvements[id]=0; pplayer->economic.gold += improvement_value(id); + building_lost(pcity, id); } } @@ -432,6 +434,21 @@ city_refresh(pcity); send_city_info(0, pcity); /* If we sold the walls the other players should see it */ send_player_info(pplayer, pplayer); +} + +/************************************************************************** +... +**************************************************************************/ +void building_lost(struct city *pcity, int id) +{ + struct player *owner = city_owner(pcity); + + pcity->improvements[id]=0; + if (id == B_PALACE && + ((owner->spaceship.state == SSHIP_STARTED) || + (owner->spaceship.state == SSHIP_LAUNCHED))) { + spaceship_lost(owner); + } } /************************************************************************** diff server/cityhand.h server/cityhand.h --- server/cityhand.h Mon Jan 1 15:59:11 2001 +++ server/cityhand.h Mon Jan 8 07:38:57 2001 @@ -30,6 +30,7 @@ struct city *pcity, int x, int y); void do_sell_building(struct player *pplayer, struct city *pcity, int id); +void building_lost(struct city *pcity, int id); void handle_city_change_specialist(struct player *pplayer, struct packet_city_request *preq); diff server/spacerace.c server/spacerace.c --- server/spacerace.c Tue Dec 26 22:52:35 2000 +++ server/spacerace.c Mon Jan 8 07:48:18 2001 @@ -156,6 +156,11 @@ struct player_spaceship *ship = &pplayer->spaceship; int arrival; + if (!find_palace(pplayer)) { + notify_player(pplayer, + _("Game: You need capital in order to launch spacesip.")); + return; + } if (ship->state >= SSHIP_LAUNCHED) { notify_player(pplayer, _("Game: Your spaceship is already launched!")); return; @@ -330,9 +335,8 @@ void spaceship_lost(struct player *pplayer) { notify_player_ex(0, -1, -1, E_SPACESHIP, - _("Game: With the capture of %s's capital, the %s" - " spaceship is lost!"), pplayer->name, - get_nation_name(pplayer->nation)); + _("Game: Without guidance from capital, the %s " + "spaceship is lost!"), get_nation_name(pplayer->nation)); spaceship_init(&pplayer->spaceship); send_spaceship_info(pplayer, 0); } diff server/unitfunc.c server/unitfunc.c --- server/unitfunc.c Sat Jan 6 14:39:25 2001 +++ server/unitfunc.c Mon Jan 8 07:50:26 2001 @@ -1055,8 +1055,6 @@ } } - /* Do it. */ - pcity->improvements[target] = 0; /* Report it. */ notify_player_ex (pplayer, pcity->x, pcity->y, E_MY_DIPLOMAT, _("Game: Your %s destroyed the %s in %s."), @@ -1068,6 +1066,9 @@ get_improvement_name (target), pcity->name); freelog (LOG_DEBUG, "sabotage: sabotaged improvement: %d (%s)", target, get_improvement_name (target)); + + /* Do it. */ + building_lost(pcity, target); } /* Update clients. */