Skip to content

Commit

Permalink
Have the creatures face training equipment instead of going inside them
Browse files Browse the repository at this point in the history
  • Loading branch information
tonihele committed Jul 5, 2024
1 parent 42804c6 commit fc95a16
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/toniarts/openkeeper/game/task/creature/Train.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import toniarts.openkeeper.tools.convert.map.Variable;
import toniarts.openkeeper.tools.convert.map.Variable.MiscVariable;
import toniarts.openkeeper.tools.convert.map.Variable.MiscVariable.MiscType;
import toniarts.openkeeper.utils.WorldUtils;

/**
* Trains creature
Expand Down Expand Up @@ -66,7 +65,12 @@ public boolean isValid(ICreatureController creature) {

@Override
public Vector2f getTarget(ICreatureController creature) {
return WorldUtils.pointToVector2f(getTaskLocation()); // FIXME 0.5f not needed?
return getAccessibleTargetNextToLocation(creature);
}

@Override
public boolean isFaceTarget() {
return true;
}

@Override
Expand All @@ -91,4 +95,8 @@ public TaskType getTaskType() {
return TaskType.TRAIN;
}

@Override
public boolean isRemovable() {
return true;
}
}

0 comments on commit fc95a16

Please sign in to comment.