Skip to content

Commit

Permalink
Merge pull request #3744 from TownyAdvanced/hotfix/flagwar
Browse files Browse the repository at this point in the history
Hotfix: Fix Flagwar townblock town transfer.
  • Loading branch information
LlmDl authored and TheFlagCourier committed Mar 12, 2020
1 parent 4569132 commit f01ac7e
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 f01ac7e

Please sign in to comment.