Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Plots are not transferred safely. #318

Closed
LlmDl opened this issue Aug 23, 2015 · 2 comments
Closed

Fix: Plots are not transferred safely. #318

LlmDl opened this issue Aug 23, 2015 · 2 comments

Comments

@LlmDl
Copy link
Member

LlmDl commented Aug 23, 2015

Originally reported on Google Code with ID 282

Plots were being traded with: townBlock.setTown(town);

Which wouldn't reset the plot owner. It wouldn't remove all the signs etc.

So instead:

TownBlock townBlock = worldCoord.getTownBlock();
universe.removeTownBlock(townBlock);

try {
    List<WorldCoord> selection = new ArrayList<WorldCoord>();
    selection.add(worldCoord);
    TownCommand.checkIfSelectionIsValid(town, selection, false, 0, false);
    TownCommand.townClaim(town, worldCoord);
    TownyUniverse.getDataSource().saveTown(town);
    TownyUniverse.getDataSource().saveWorld(world);

    //TODO
    //PlotCommand.plotClaim(resident, worldCoord);
    //TownyUniverse.getDataSource().saveResident(resident);
    //TownyUniverse.getDataSource().saveWorld(world);
} catch (TownyException te) {
    // Couldn't claim it.
}

The only foreseeable problem with this is that the regen code is stopped? Also, the
plot will start reverting?

Reported by zrenfire on 2011-09-22 15:42:29


- _Attachment: [patch.txt](https://storage.googleapis.com/google-code-attachments/towny/issue-282/comment-0/patch.txt)_
@LlmDl
Copy link
Member Author

LlmDl commented Aug 23, 2015

This is part of the new war code.

Reported by zrenfire on 2011-09-22 15:47:38

  • Labels added: Label-War

@LlmDl
Copy link
Member Author

LlmDl commented Aug 23, 2015

Added.

Reported by [email protected] on 2011-09-22 18:48:36

  • Status changed: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant