Skip to content

Commit b804e82

Browse files
authored
Merge pull request #73 from Tyoda/hitchingpost-fix
fix horses getting stuck in zones, and throwing errors in the log
2 parents b2ddc46 + 8d045d3 commit b804e82

File tree

1 file changed

+6
-0
lines changed
  • modules/demo/hitchingpost/src/main/java/org/gotti/wurmunlimited/mods/hitchingpost

1 file changed

+6
-0
lines changed

modules/demo/hitchingpost/src/main/java/org/gotti/wurmunlimited/mods/hitchingpost/UnhitchAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ public List<ActionEntry> getBehavioursFor(Creature performer, Creature target) {
7676
public boolean action(Action action, Creature performer, Creature target, short num, float counter) {
7777
if (canUnhitch(performer, target)) {
7878
final Vehicle hitched = target.getHitched();
79+
if (!hitched.positionDragger(target, performer)) {
80+
performer.getCommunicator().sendNormalServerMessage("You can't unhitch the " + target.getName() + ". Please contact an administrator.");
81+
logger.warning(performer.getName()+" was not able to unhitch the "+target.getName()+" from a hitching post at "+target.getTileX()+","+target.getTileY());
82+
return propagate(action);
83+
}
84+
7985
try {
8086
final Zone z = Zones.getZone(target.getTilePos(), target.isOnSurface());
8187
target.getStatus().savePosition(target.getWurmId(), true, z.getId(), true);

0 commit comments

Comments
 (0)