KeplerBR

[FreeCol] Simple fix: Claim tile before choosing name of the

May 11th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.08 KB | None | 0 0
  1.  .../sf/freecol/client/control/InGameController.java | 21 +++++++++++----------
  2.  1 file changed, 11 insertions(+), 10 deletions(-)
  3.  
  4. diff --git a/src/net/sf/freecol/client/control/InGameController.java b/src/net/sf/freecol/client/control/InGameController.java
  5. index d575476..c1c01c6 100644
  6. --- a/src/net/sf/freecol/client/control/InGameController.java
  7. +++ b/src/net/sf/freecol/client/control/InGameController.java
  8. @@ -1569,16 +1569,6 @@ public final class InGameController implements NetworkConstants {
  9.              && !buildColonyShowWarnings(tile, unit)) {
  10.              return;
  11.          }
  12. -
  13. -        if (tile.getOwner() != null && !player.owns(tile)) {
  14. -            // Claim tile from other owners before founding a settlement.
  15. -            // Only native owners that we can steal, buy from, or use a
  16. -            // bonus center tile exception should be possible by this point.
  17. -            if (!claimTile(player, tile, unit, player.getLandPrice(tile), 0))
  18. -                return;
  19. -            // One more check that founding can now proceed.
  20. -            if (!player.canClaimToFoundSettlement(tile)) return;
  21. -        }
  22.          
  23.          // Get and check the name.
  24.          String name = player.getSettlementName(null);
  25. @@ -1598,6 +1588,17 @@ public final class InGameController implements NetworkConstants {
  26.              return;
  27.          }
  28.  
  29. +        // Claim tile from other owners before founding a settlement.
  30. +        if (tile.getOwner() != null && !player.owns(tile)) {
  31. +            // Only native owners that we can steal, buy from, or use a
  32. +            // bonus center tile exception should be possible by this point.
  33. +            if (!claimTile(player, tile, unit, player.getLandPrice(tile), 0))
  34. +                return;
  35. +            // One more check that founding can now proceed.
  36. +            if (!player.canClaimToFoundSettlement(tile)) return;
  37. +        }
  38. +        
  39. +        // Build colony
  40.          if (askServer().buildColony(name, unit) && tile.hasSettlement()) {
  41.              player.invalidateCanSeeTiles();
  42.              gui.playSound("sound.event.buildingComplete");
Add Comment
Please, Sign In to add comment