Fix permision to withdraw money and chunk border/connected checking.

This commit is contained in:
Olof Larsson
2013-05-17 08:37:32 +02:00
parent a79577a355
commit ac95004450
3 changed files with 11 additions and 3 deletions

View File

@ -224,6 +224,8 @@ public class Board extends Entity<Board> implements BoardInterface
@Override
public boolean isBorderPs(PS ps)
{
ps = ps.getChunk(true);
PS nearby = null;
Faction faction = this.getFactionAt(ps);
@ -246,6 +248,8 @@ public class Board extends Entity<Board> implements BoardInterface
@Override
public boolean isConnectedPs(PS ps, Faction faction)
{
ps = ps.getChunk(true);
PS nearby = null;
nearby = ps.withChunkX(ps.getChunkX() +1);

View File

@ -668,7 +668,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
(
uconf.claimsMustBeConnected
&& newFaction.getLandCountInWorld(ps.getWorld()) > 0
&& !BoardColls.get().isConnectedPs(ps, newFaction)
&& !BoardColls.get().isConnectedPs(chunk, newFaction)
&& (!uconf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !oldFaction.isNormal())
)
{
@ -706,7 +706,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
return false;
}
if ( ! BoardColls.get().isBorderPs(ps))
if ( ! BoardColls.get().isBorderPs(chunk))
{
msg("<b>You must start claiming land at the border of the territory.");
return false;