Skip to content

Commit

Permalink
Fix Flagwar townblock town transfer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Suneet Tipirneni (Siris) committed Mar 6, 2020
1 parent bb265cb commit dfe2953
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,14 @@ public void onCellWonEvent(CellWonEvent event) {

// Defender loses townblock
if (TownyWarConfig.isFlaggedTownblockTransfered()) {
// Defender loses townblock
universe.getDataSource().removeTownBlock(townBlock);

// Attacker Claim Automatically
try {
List<WorldCoord> selection = new ArrayList<>();
selection.add(worldCoord);
TownCommand.checkIfSelectionIsValid(attackingTown, selection, false, 0, false);
new TownClaim(plugin, null, attackingTown, selection, false, true, false).start();
} catch (TownyException te) {
townBlock.setTown(attackingTown);
TownyUniverse.getInstance().getDataSource().saveTownBlock(townBlock);
} catch (Exception te) {
// Couldn't claim it.
TownyMessaging.sendErrorMsg(te.getMessage());
te.printStackTrace();
}
} else {

Expand Down

0 comments on commit dfe2953

Please sign in to comment.