diff --git a/src/rotp/model/colony/Colony.java b/src/rotp/model/colony/Colony.java index ee41cbe08..9455170a0 100644 --- a/src/rotp/model/colony/Colony.java +++ b/src/rotp/model/colony/Colony.java @@ -39,6 +39,7 @@ import rotp.model.tech.TechMissileWeapon; import rotp.model.tech.TechTree; import rotp.ui.RotPUI; +import rotp.ui.main.TransportDeploymentPanel; import rotp.ui.notifications.GNNNotification; import rotp.ui.notifications.InvadersKilledAlert; import rotp.ui.notifications.TransportsKilledAlert; @@ -946,13 +947,15 @@ public void scheduleTransportsToSystem(StarSystem dest, int pop, float travelTim } } public void scheduleTransportsToSystem(StarSystem dest, int pop) { - // adjust pop to max allowed - - int xPop = min(pop, maxTransportsAllowed()); - log("Scheduling " + xPop + " transports from: " + starSystem().name() + " to: " + dest.name()); + // If pop is the entire current population then accept it if abandonment is + // permitted, otherwise adjust it to the max allowed. + if (pop < population() || !TransportDeploymentPanel.enableAbandon) { + pop = min(pop, maxTransportsAllowed()); + } + log("Scheduling " + pop + " transports from: " + starSystem().name() + " to: " + dest.name()); // if zero or to this system, then clear - if ((dest == starSystem()) || (xPop == 0)) + if ((dest == starSystem()) || (pop == 0)) clearTransport(); else { transport().size(pop); diff --git a/src/rotp/ui/main/TransportDeploymentPanel.java b/src/rotp/ui/main/TransportDeploymentPanel.java index 33210c114..d72a08e09 100644 --- a/src/rotp/ui/main/TransportDeploymentPanel.java +++ b/src/rotp/ui/main/TransportDeploymentPanel.java @@ -46,6 +46,22 @@ public class TransportDeploymentPanel extends SystemPanel { private static final long serialVersionUID = 1L; + // NOTE: This use of a public static variable needs rework because it permits an in-game exploit: + // - Pick a system and abandon it to any valid target (own) system. + // - Select the same source system and click "Send Transports". + // - Choose any valid target system (which can include an enemy system). + // - Adjust the population to any value greater than half of but below the current full colony size. + // - Click the green "Send Transports" button to confirm. + // - Next turn the game ships the specified number of transports without abandoning the colony. + // This can be used to muster force against an enemy in excess of what should be possible, but + // it can also be used defensively or economically to rapidly populate one's own system(s) from + // back-line colonies. + // The essential nature of the issue is that committing the abandon action sets this global flag + // indefinitely until the regular transport action is invoked on some system. The most effective + // solution is to make the abandonment (intent) flag transient to the UI action and capture it + // elsewhere, perhaps in the transport object itself or in the colony object (latter would require + // differentiation from the "abandoned" flag that gets set when the population actually + // gets shipped). public static boolean enableAbandon = false; protected BasePanel topPane; protected BasePanel detailPane;