Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Governor is required on planet before orbital can be built #621

Closed
tuomount opened this issue Sep 17, 2023 · 1 comment
Closed

Governor is required on planet before orbital can be built #621

tuomount opened this issue Sep 17, 2023 · 1 comment
Labels
bug Verified bug which needs fixing Wait for verify Issue has been implemented but needs verification that it works.
Milestone

Comments

@tuomount
Copy link
Owner

There is a bug where governor is required on planet before orbital can be built or upgraded.
Bug was caused this git change:

commit ee165f6
Author: Tuomo Untinen tuomo.untinen@iki.fi
Date: Sat Aug 5 12:13:50 2023 +0300

#616 Fixes issue where governor selectes same orbital.

This happens when orbital was finished and it hasn't been
assigned to planet yet when new list of constructions available was
generated.
diff --git a/src/main/java/org/openRealmOfStars/player/ship/Ship.java b/src/main/java/org/openRealmOfStars/player/ship/Ship.java
index 9ab11351..db829279 100644
--- a/src/main/java/org/openRealmOfStars/player/ship/Ship.java
+++ b/src/main/java/org/openRealmOfStars/player/ship/Ship.java
@@ -2328,7 +2328,7 @@ private int increaseHitChanceByComponent() {
     }
     if (getHull().getSize() == ShipSize.SMALL
         && getHull().getHullType() != ShipHullType.FREIGHTER
-        && !isColonyModule() && !isStarBase()) {
+        && !isColonyModule() && !isStarBaseOrOrbital()) {
       return true;
     }
     return false;
diff --git a/src/main/java/org/openRealmOfStars/starMap/planet/Planet.java b/src/main/java/org/openRealmOfStars/starMap/planet/Planet.java
index e099152a..91c0270f 100644
--- a/src/main/java/org/openRealmOfStars/starMap/planet/Planet.java
+++ b/src/main/java/org/openRealmOfStars/starMap/planet/Planet.java
@@ -2579,6 +2579,7 @@ public class Planet {
             if (governor != null) {
               int index = map.getPlayerList().getIndex(getPlanetPlayerInfo());
               Attitude attitude = LeaderUtility.getRulerAttitude(governor);
+              orbital = ship;
               PlanetHandling.chooseNextConstruction(map, this, index, attitude);
               sb.append(" " + governor.getCallName() + " selected new "
                   + "construction process where "
@@ -2586,7 +2587,6 @@ public class Planet {
                   + " will be built. Estimated building time is "
                   + getProductionTimeAsString(underConstruction) + ".");
             }
-            orbital = ship;
             msg = new Message(MessageType.CONSTRUCTION, sb.toString(),
                 Icons.getIconByName(Icons.ICON_STARBASE));
             msg.setCoordinate(getCoordinate());

@tuomount tuomount added the bug Verified bug which needs fixing label Sep 17, 2023
@tuomount tuomount added this to the 0.25.0Beta milestone Sep 17, 2023
tuomount added a commit that referenced this issue Sep 17, 2023
Changed text that orbital upgrade if military power is equal or greater.
Otherwise it is called downgrade.
@tuomount tuomount added the Wait for verify Issue has been implemented but needs verification that it works. label Sep 17, 2023
@tuomount
Copy link
Owner Author

Works now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified bug which needs fixing Wait for verify Issue has been implemented but needs verification that it works.
Projects
None yet
Development

No branches or pull requests

1 participant