Skip to content

Commit

Permalink
fix some Thief bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwedeck committed Aug 19, 2023
1 parent 89a41fc commit ad14987
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,17 @@ private static Node<BearerMovable> handleOffer() {
EOfferPriority minimumAcceptedPriority = mov.request != null ? mov.request.getMinimumAcceptedOfferPriority() : EOfferPriority.LOWEST;
return mov.offer.isStillValid(minimumAcceptedPriority);
}),
take(mov -> mov.materialType, true),
selector(
take(mov -> mov.materialType, true),
sequence(
action(mov -> {
// material might have been stolen
mov.offer.offerTaken();
mov.offer = null;
}),
alwaysFail()
)
),
action(mov -> {
mov.offer.offerTaken();
mov.offer = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ public static Node<ThiefMovable> createThiefBehaviour() {
selector(
condition(mov -> mov.getMaterial() != EMaterialType.NO_MATERIAL),
sequence(
stealMaterial(),
action(mov -> {
//
mov.goToTarget = mov.returnPos;
})
}),
stealMaterial()
)
)
)
Expand Down

0 comments on commit ad14987

Please sign in to comment.