Partial fix for issue #23. Objects that are still 'walkable' should be

excluded from the additional distance.
This commit is contained in:
Joe0 2011-12-02 09:13:22 -06:00
parent 03a200a1bb
commit 1f064e322a
2 changed files with 3 additions and 2 deletions

View File

@ -29,8 +29,8 @@ public abstract class WalkToPointEvent extends DelayedEvent {
public final void run() { public final void run() {
if (stop && owner.withinRange(location, radius)) { if (stop && owner.withinRange(location, radius)) {
owner.resetPath();
arrived(); arrived();
owner.resetPath();
} else if (owner.hasMoved()) { } else if (owner.hasMoved()) {
return; // We're still moving return; // We're still moving
} else if (owner.withinRange(location, radius)) { } else if (owner.withinRange(location, radius)) {

View File

@ -75,8 +75,9 @@ public class PickupItem implements PacketHandler {
} }
player.setStatus(Action.TAKING_GITEM); player.setStatus(Action.TAKING_GITEM);
int distance = tile.hasGameObject() ? 1 : 0;
Instance.getDelayedEventHandler().add( Instance.getDelayedEventHandler().add(
new WalkToPointEvent(player, location, 0, true) { new WalkToPointEvent(player, location, distance, true) {
public void arrived() { public void arrived() {
if (owner.isBusy() || owner.isRanging() if (owner.isBusy() || owner.isRanging()
|| !tile.hasItem(item) || !owner.nextTo(item) || !tile.hasItem(item) || !owner.nextTo(item)