Skip to content

Commit

Permalink
Release 0.95.250
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Aug 19, 2024
1 parent 0bbeaae commit c98a50e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
Binary file added install/open-ig-0.95.250.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/hu/openig/mechanics/DefaultAIControls.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ Location findLocationForPlanetaryDefenseBuilding(Planet planet) {
return b.location();
}
ArrayList<Location> corners = new ArrayList<>();
corners.add(Location.of(0,0));
corners.add(Location.of(-planet.surface.height + 1,-planet.surface.height + 1));
corners.add(Location.of(0, 0));
corners.add(Location.of(-planet.surface.height + 1, -planet.surface.height + 1));
corners.add(Location.of(planet.surface.width - planet.surface.height + 1, - planet.surface.height - planet.surface.width + 1));
corners.add(Location.of(planet.surface.width - 1, -planet.surface.width + 1));
return corners.get((new Random()).nextInt(4));
Expand Down
10 changes: 3 additions & 7 deletions src/hu/openig/mechanics/SpaceWarMovementHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,16 @@ boolean reserveCellFor(WarUnit unit) {
SpacewarStructure sws = (SpacewarStructure) unit;
if (sws.item.type.category == ResearchSubCategory.SPACESHIPS_FIGHTERS) {
return super.reserveCellFor(unit);
} else {
return reserveCellForCapitalShip(unit);
}
return reserveCellForCapitalShip(unit);
}
@Override
boolean isCellReserved(Location loc, WarUnit unit) {
SpacewarStructure sws = (SpacewarStructure) unit;
if (sws.item.type.category == ResearchSubCategory.SPACESHIPS_FIGHTERS) {
return super.isCellReserved(loc, unit);
} else {
return isCellReservedForCapitalShip(loc, unit);
}
return isCellReservedForCapitalShip(loc, unit);
}
/**
* Reserve the next movement cell for the capital ship.
Expand Down Expand Up @@ -155,10 +153,8 @@ boolean isPassable(Location loc, WarUnit unit) {
SpacewarStructure sws = (SpacewarStructure) unit;
if (sws.item.type.category == ResearchSubCategory.SPACESHIPS_FIGHTERS) {
return isPassableForFighter(loc, unit);
} else {
boolean ip = isPassableForCapitalShip(loc, unit);
return ip;
}
return isPassableForCapitalShip(loc, unit);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hu/openig/model/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class Configuration {
/** The version string. */
public static final String VERSION = "0.95.249";
public static final String VERSION = "0.95.250";
/** Annotation for indicating load/save a field. */
@Retention(RetentionPolicy.RUNTIME)
@interface LoadSave { }
Expand Down
12 changes: 12 additions & 0 deletions src/hu/openig/model/PlanetSurface.java
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ public static class SurfaceCellArray {
public SurfaceCellArray() { }
/**
* Create a copy of this object.
* @return the copy
* */
public SurfaceCellArray copy() {
SurfaceCellArray copyObject = new SurfaceCellArray();
Expand Down Expand Up @@ -1089,24 +1090,35 @@ public void clearAllNonSurfaceElements() {
}
}
/**
* Check if a location has pavement.
* @param loc the location
* @return true if surface tile has pavement
*/
public boolean hasPavement(Location loc) {
return (surfaceArray[getArrayIndexForLocation(loc.x, loc.y)] & PAVED_FEATURE) != 0;
}
/**
* Check if a coordinate has road.
* @param x the X coordinate
* @param y the Y coordinate
* @return true if surface tile has road
*/
public boolean hasRoad(int x, int y) {
return (surfaceArray[getArrayIndexForLocation(x, y)] & ROAD) != 0;
}
/**
* Check if a tile has a crossroad.
* @param x the X coordinate
* @param y the Y coordinate
* @return true if surface tile has crossroad
*/
public boolean hasCrossRoad(int x, int y) {
return (surfaceArray[getArrayIndexForLocation(x, y)] & CROSSROAD) != 0;
}
/**
* Check if a cell is buildable.
* @param x the X coordinate
* @param y the Y coordinate
* @return true if surface tile is in a state where a building can be put on it
*/
public boolean isCellBuildable(int x, int y) {
Expand Down
2 changes: 1 addition & 1 deletion src/hu/openig/screen/items/SpacewarScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ List<SpacewarStructure> getSelection() {
return result;
}
/**
* @return Returns a list of the currently selected structures.
* Clears the selection of structures.
*/
void clearSelection() {
for (SpacewarStructure s : structures) {
Expand Down
7 changes: 5 additions & 2 deletions update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<desc lang='en'>The launcher&#39;s main file</desc>
</file>
</module>
<module id='Game' version='0.95.249'>
<module id='Game' version='0.95.250'>
<general url='https://github.com/akarnokd/open-ig'>
<desc lang='hu'>
Az Open Imperium Galactica játék.
Expand All @@ -42,6 +42,9 @@
<desc lang='es'>Bugfixes</desc>
</notes>
<release-details>
<entry version='0.95.250' date='2024-08-19'>
<item category='Spacewar' issues='1159'>Fixed a crash and slowdown caused by multiple fatal hits on a spaceship or structure. By @hemoridos</item>
</entry>
<entry version='0.95.249' date='2024-08-01'>
<item category='Internal' issues='1152,1153'>Various bugfixes and optimizations. By @hemoridos</item>
<item category='UI,Diplomacy' issues='1154'>Diplomacy screen no longer shows defeated empires. By @hemoridos</item>
Expand Down Expand Up @@ -304,7 +307,7 @@
<item category='AI'>Fixed AI unable to build a power plant if the missing energy was above the capacity of available power plant types.</item>
</entry>
</release-details>
<file url='https://github.com/akarnokd/open-ig/raw/master/install/open-ig-0.95.249.jar' sha1='73338333746D89A882DDC3AFF8174B854660B827'/>
<file url='https://github.com/akarnokd/open-ig/raw/master/install/open-ig-0.95.250.jar' sha1='6A980F150BC423F93C719F87A78212B33539667C'/>
<file url='https://github.com/akarnokd/open-ig/raw/master/install/open-ig-upgrade-20240801a2.zip' sha1='3D7925BD62DDDB70DE0CD69C6E9B9704B2132E55'/>
<file url='https://github.com/akarnokd/open-ig/raw/master/install/open-ig-images-20240607a.zip' sha1='E5E626A18FF968CF646A041D333B3C664394D848'/>
<file url='https://github.com/akarnokd/open-ig/raw/master/open-ig-splash.png' sha1='52b83dbe118575c7dd3dd6c8c41d0446c32dee45'/>
Expand Down

0 comments on commit c98a50e

Please sign in to comment.