|
@@ -855,6 +855,23 @@ void ScriptPlanet::server_prompt(const std::string &prompt) {
|
|
|
|
|
|
BUGZ_LOG(fatal) << "Total population: " << total_population;
|
|
|
|
|
|
+ // FIXUP: Empty out the ship holds if they aren't empty.
|
|
|
+
|
|
|
+ for (int x = 0; x < 3; ++x) {
|
|
|
+ if (ship[x] != 0) {
|
|
|
+ std::string message = str(
|
|
|
+ boost::format("Transfer ship cargo %1% (%2%) to planet.\n\r") %
|
|
|
+ foe[x] % ship[x]);
|
|
|
+ to_client(message);
|
|
|
+ std::string transfer = "TNL";
|
|
|
+ transfer.append(std::to_string(x + 1));
|
|
|
+ transfer.append("\r");
|
|
|
+ to_server(transfer);
|
|
|
+ ship[x] = 0;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// citadel, upgrade
|
|
|
// what is the message when you don't have a citadel yet?
|
|
|
state = 6;
|
|
@@ -867,9 +884,14 @@ void ScriptPlanet::server_prompt(const std::string &prompt) {
|
|
|
endswith(prompt, "? ")) {
|
|
|
// Do we have what we need?
|
|
|
bool ready = true;
|
|
|
+
|
|
|
if (total_population < support_construction) {
|
|
|
ready = false;
|
|
|
state = 9;
|
|
|
+ std::string message =
|
|
|
+ str(boost::format("Planet has %1% people, need %2%.\n\r") %
|
|
|
+ total_population % support_construction);
|
|
|
+ to_client(message);
|
|
|
BUGZ_LOG(fatal) << "Need people ["
|
|
|
<< support_construction - total_population << "]";
|
|
|
}
|
|
@@ -880,6 +902,10 @@ void ScriptPlanet::server_prompt(const std::string &prompt) {
|
|
|
ready = false;
|
|
|
state = 12;
|
|
|
}
|
|
|
+ std::string message =
|
|
|
+ str(boost::format("Has %1% of %2%, needs %3%\n\r") % amount[x] %
|
|
|
+ foe[x] % needs[x]);
|
|
|
+ to_client(message);
|
|
|
BUGZ_LOG(fatal) << "Need " << x << " :" << needs[x] - amount[x];
|
|
|
}
|
|
|
}
|