From 727aad337a2e4747b185233fc0590958cba93c40 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 10 Dec 2017 22:48:16 +0200 Subject: [PATCH] Fixed bug in GetVectorsAtDistance and bug where if you started the game with free techs to pick the next turn button would not be visible --- core/src/com/unciv/civinfo/CivilizationInfo.java | 2 +- core/src/com/unciv/game/HexMath.java | 3 ++- core/src/com/unciv/game/WorldScreen.java | 1 - core/src/com/unciv/game/pickerscreens/TechPickerScreen.java | 4 ---- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/com/unciv/civinfo/CivilizationInfo.java b/core/src/com/unciv/civinfo/CivilizationInfo.java index 88e5a9b51e..59a3983e0d 100644 --- a/core/src/com/unciv/civinfo/CivilizationInfo.java +++ b/core/src/com/unciv/civinfo/CivilizationInfo.java @@ -59,7 +59,7 @@ public class CivilizationInfo { }); } - public void nextTurn()//out boolean displayTech) + public void nextTurn() { notifications.clear(); CivStats nextTurnStats = getStatsForNextTurn(); diff --git a/core/src/com/unciv/game/HexMath.java b/core/src/com/unciv/game/HexMath.java index e74b2e4bb8..ef5c1915e1 100644 --- a/core/src/com/unciv/game/HexMath.java +++ b/core/src/com/unciv/game/HexMath.java @@ -48,6 +48,7 @@ public class HexMath public static ArrayList GetVectorsAtDistance(Vector2 origin, int distance){ ArrayList vectors = new ArrayList(); + if(distance==0){vectors.add(origin.cpy()); return vectors;} Vector2 Current = origin.cpy().sub(distance,distance); // start at 6 o clock for (int i = 0; i < distance; i++) { // From 6 to 8 vectors.add(Current.cpy()); @@ -62,7 +63,7 @@ public class HexMath for (int i = 0; i < distance; i++) { // 10 to 12 vectors.add(Current.cpy()); vectors.add(origin.cpy().scl(2).sub(Current)); // Get vector on other side of cloick - Current.add(1,1); + Current.add(0,1); }; return vectors; } diff --git a/core/src/com/unciv/game/WorldScreen.java b/core/src/com/unciv/game/WorldScreen.java index d82ffc2ae1..830742b225 100644 --- a/core/src/com/unciv/game/WorldScreen.java +++ b/core/src/com/unciv/game/WorldScreen.java @@ -96,7 +96,6 @@ public class WorldScreen extends CameraStageBaseScreen { public void update(){ if(game.civInfo.tech.freeTechs!=0) { game.setScreen(new TechPickerScreen(game, true)); - return; } updateTechButton(); updateTileTable(); diff --git a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java index 821e478a04..bc9be609e1 100644 --- a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java @@ -93,14 +93,10 @@ public class TechPickerScreen extends PickerScreen { StringBuilder text = new StringBuilder(techName); if (selectedTech != null) { - Technology thisTech = GameBasics.Technologies.get(techName); if (techName.equals(selectedTech.name)) { TB.setChecked(true); TB.setColor(TB.getColor().lerp(Color.LIGHT_GRAY, 0.5f)); } - - if (thisTech.prerequisites.contains(selectedTech.name)) text.insert(0, "*"); - else if (selectedTech.prerequisites.contains(techName)) text.append("*"); } if (techsToResearch.contains(techName)) { text.append(" (").append(techsToResearch.indexOf(techName)).append(")");