KeplerBR

FreeCol - Fixbug in Fog of War

Oct 20th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.95 KB | None | 0 0
  1.  src/net/sf/freecol/common/model/Player.java | 62 ++++++++++++++++-------------
  2.  1 file changed, 34 insertions(+), 28 deletions(-)
  3.  
  4. diff --git a/src/net/sf/freecol/common/model/Player.java b/src/net/sf/freecol/common/model/Player.java
  5. index ba756d4..7a28c8d 100644
  6. --- a/src/net/sf/freecol/common/model/Player.java
  7. +++ b/src/net/sf/freecol/common/model/Player.java
  8. @@ -2790,39 +2790,45 @@ public class Player extends FreeColGameObject implements Nameable {
  9.                  cST[t.getX()][t.getY()] = true;
  10.                  t.seeTile(this);
  11.              }
  12. -            // All the settlements.
  13. -            for (Settlement settlement : getSettlements()) {
  14. -                for (Tile t : settlement.getTile().getSurroundingTiles(0,
  15. -                        settlement.getLineOfSight())) {
  16. -                    cST[t.getX()][t.getY()] = true;
  17. -                    t.seeTile(this);
  18. -                }
  19. +        }
  20. +        // All the settlements.
  21. +        for (Settlement settlement : getSettlements()) {
  22. +            for (Tile t : settlement.getTile().getSurroundingTiles(0,
  23. +                    settlement.getLineOfSight())) {
  24. +                cST[t.getX()][t.getY()] = true;
  25. +                t.seeTile(this);
  26.              }
  27. -            // All missions if using enhanced missionaries.
  28. -            if (isEuropean()
  29. +        }
  30. +        // All missions if using enhanced missionaries.
  31. +        if (isEuropean()
  32.                  && spec.getBoolean(GameOptions.ENHANCED_MISSIONARIES)) {
  33. -                for (Player other : getGame().getPlayers()) {
  34. -                    if (this.equals(other) || !other.isIndian()) continue;
  35. -                    for (IndianSettlement is : other.getIndianSettlements()) {
  36. -                        if (!is.hasMissionary(this)) continue;
  37. -                        for (Tile t : is.getTile().getSurroundingTiles(0,
  38. -                                is.getLineOfSight())) {
  39. -                            cST[t.getX()][t.getY()] = true;
  40. -                            t.seeTile(this);
  41. -                        }
  42. +            for (Player other : getGame().getPlayers()) {
  43. +                if (this.equals(other) || !other.isIndian()) {
  44. +                    continue;
  45. +                }
  46. +                for (IndianSettlement is : other.getIndianSettlements()) {
  47. +                    if (!is.hasMissionary(this)) {
  48. +                        continue;
  49. +                    }
  50. +                    for (Tile t : is.getTile().getSurroundingTiles(0,
  51. +                            is.getLineOfSight())) {
  52. +                        cST[t.getX()][t.getY()] = true;
  53. +                        t.seeTile(this);
  54.                      }
  55.                  }
  56.              }
  57. -            // All other European settlements if can see all colonies.
  58. -            if (isEuropean() && hasAbility(Ability.SEE_ALL_COLONIES)) {
  59. -                for (Player other : getGame().getPlayers()) {
  60. -                    if (this.equals(other) || !other.isEuropean()) continue;
  61. -                    for (Colony colony : other.getColonies()) {
  62. -                        for (Tile t : colony.getTile().getSurroundingTiles(0,
  63. -                                colony.getLineOfSight())) {
  64. -                            cST[t.getX()][t.getY()] = true;
  65. -                            t.seeTile(this);
  66. -                        }
  67. +        }
  68. +        // All other European settlements if can see all colonies.
  69. +        if (isEuropean() && hasAbility(Ability.SEE_ALL_COLONIES)) {
  70. +            for (Player other : getGame().getPlayers()) {
  71. +                if (this.equals(other) || !other.isEuropean()) {
  72. +                    continue;
  73. +                }
  74. +                for (Colony colony : other.getColonies()) {
  75. +                    for (Tile t : colony.getTile().getSurroundingTiles(0,
  76. +                            colony.getLineOfSight())) {
  77. +                        cST[t.getX()][t.getY()] = true;
  78. +                        t.seeTile(this);
  79.                      }
  80.                  }
  81.              }
Add Comment
Please, Sign In to add comment