Skip to content

Commit

Permalink
Update for 2.14.0-beta.dev.20241004.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetech committed Oct 4, 2024
1 parent fbbccbd commit 3c31fee
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"watch": "npx tsc --build --watch --pretty --preserveWatchOutput"
},
"devDependencies": {
"@wayward/types": "^2.14.0-beta.dev.20241003.1",
"@wayward/types": "^2.14.0-beta.dev.20241004.1",
"rimraf": "3.0.2",
"typescript": "^5.6.2"
}
Expand Down
7 changes: 3 additions & 4 deletions src/objectives/core/ExecuteActionForItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,11 @@ export default class ExecuteActionForItem<T extends AnyActionDescription> extend
}

private async tryPickUpItem(context: Context, itemTypes: Set<ItemType>, tile: Tile): Promise<ObjectiveResult | undefined> {
const lastTileItem = tile.containedItems && tile.containedItems.length > 0 ?
tile.containedItems[tile.containedItems.length - 1] : undefined;
if (lastTileItem !== undefined && itemTypes.has(lastTileItem.type)) {
const matchingTileItem = tile.containedItems?.filter(item => itemTypes.has(item.type))?.[0];
if (matchingTileItem) {
const matchingNewItems: Item[] = [];

const matchingItem = await this.executeActionCompareInventoryItems(context, itemTypes, { action: PickUpItem, args: [context.human.tile === tile] });
const matchingItem = await this.executeActionCompareInventoryItems(context, itemTypes, { action: PickUpItem, args: [context.human.tile === tile, [matchingTileItem]] });
if (typeof (matchingItem) === "number") {
this.log.warn("Issue moving items", ObjectiveResult[matchingItem]);
return matchingItem;
Expand Down
2 changes: 1 addition & 1 deletion src/objectives/other/item/MoveItemsFromTileContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class MoveItemsFromTileContainer extends Objective {
return ObjectiveResult.Complete;
}

return [context.human.tile === this.source] as ActionArgumentsOf<typeof PickUpItem>;
return [context.human.tile === this.source, items] as ActionArgumentsOf<typeof PickUpItem>;
}).setStatus(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/ItemUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export class ItemUtilities {
tool = this.getBestTool(context, ActionType.Harvest);

} else {
const skillType = description.gatherSkillUse ?? description.skillUse; // ?? SkillType.Mining;
const skillType = description.gatherSkillUse ?? doodad.getSkillUse();
// const prefersBlunt = skillType === SkillType.Mining;
tool = this.getBestTool(context, skillType === SkillType.Lumberjacking ? ActionType.Chop : ActionType.Mine); // prefersBlunt ? DamageType.Blunt : DamageType.Slashing);
}
Expand Down

0 comments on commit 3c31fee

Please sign in to comment.