From 457d3e070573ea6e29547580afff24c224eaf1d3 Mon Sep 17 00:00:00 2001 From: Spacetech <824323+Spacetech@users.noreply.github.com> Date: Mon, 6 Jan 2025 06:03:44 -0800 Subject: [PATCH] Update for 2.14.4-beta.dev.20250106.1 --- package-lock.json | 8 ++++---- package.json | 2 +- src/core/navigation/Navigation.ts | 20 ++++++++++++++----- .../doodad/waterSource/StartSolarStill.ts | 6 +++++- .../StartWaterStillDesalination.ts | 4 ++++ 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43e1b82..00ef936 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "@wayward/tars", "version": "1.0.0", "devDependencies": { - "@wayward/types": "^2.14.4-beta.dev.20250105.1", + "@wayward/types": "^2.14.4-beta.dev.20250106.1", "rimraf": "3.0.2", "typescript": "^5.7.2" } @@ -34,9 +34,9 @@ } }, "node_modules/@wayward/types": { - "version": "2.14.4-beta.dev.20250105.1", - "resolved": "https://registry.npmjs.org/@wayward/types/-/types-2.14.4-beta.dev.20250105.1.tgz", - "integrity": "sha512-KviRh6RGnCc6Mw+Wd7XlKwna/xTKr+Fs/s+zYe+GbMR6w4u4P/WjsfvAJIp8fL5KMOhF+WF/LpacrtRWR5pg4g==", + "version": "2.14.4-beta.dev.20250106.1", + "resolved": "https://registry.npmjs.org/@wayward/types/-/types-2.14.4-beta.dev.20250106.1.tgz", + "integrity": "sha512-EM1ewxNr6pL8vesJlwufYtRqKg+uJ21L5T3L+5qP+17k5n8LcdbeH0dOtc6GR6/78aZodHs5sZcF3l6CK7MweA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 3c44ee7..d8352e8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "watch": "npx tsc --build --watch --pretty --preserveWatchOutput" }, "devDependencies": { - "@wayward/types": "^2.14.4-beta.dev.20250105.1", + "@wayward/types": "^2.14.4-beta.dev.20250106.1", "rimraf": "3.0.2", "typescript": "^5.7.2" } diff --git a/src/core/navigation/Navigation.ts b/src/core/navigation/Navigation.ts index dc04a58..dcbce0a 100644 --- a/src/core/navigation/Navigation.ts +++ b/src/core/navigation/Navigation.ts @@ -316,16 +316,26 @@ export default class Navigation { continue; } - let nextNoSlipTile: Tile | undefined = neighborTile; + let connectionTile: Tile | undefined = neighborTile; // if the entity can slip on this tile, we will assume they will and take that into account - while (nextNoSlipTile && !nextNoSlipTile.hasBlockingTerrain && !nextNoSlipTile.hasBlockingDoodad && nextNoSlipTile.canSlip(undefined, true, true)) { + while (connectionTile) { // direction ??= tile.getDirectionToTile(nextNoSlipTile); - nextNoSlipTile = nextNoSlipTile.getTileInDirection(direction); + const nextConnectionTile = connectionTile.getTileInDirection(direction); + const canSlipOntoNextTile = nextConnectionTile && + !nextConnectionTile.hasBlockingTerrain && + !nextConnectionTile.hasBlockingDoodad && + connectionTile.canSlip(undefined, true, true); + if (!canSlipOntoNextTile) { + break; + } + + connectionTile = nextConnectionTile; } - if (nextNoSlipTile) { - mapInfo.dijkstraMap.connectNodes(tile.x, tile.y, nextNoSlipTile.x, nextNoSlipTile.y, direction); + // only update the connection if it's different (not the current neighbor tile) + if (connectionTile && connectionTile !== neighborTile) { + mapInfo.dijkstraMap.connectNodes(tile.x, tile.y, connectionTile.x, connectionTile.y, direction); // mapInfo.dijkstraMap.getNode(tile.x, tile.y).connectTo(mapInfo.dijkstraMap.getNode(nextNoSlipTile.x, nextNoSlipTile.y), direction); // mapInfo.dijkstraMap.getNode(tile.x, tile.y).connectTo(mapInfo.dijkstraMap.getNode(nextNoSlipTile.x, nextNoSlipTile.y), Direction.OPPOSITES[direction]); } diff --git a/src/objectives/other/doodad/waterSource/StartSolarStill.ts b/src/objectives/other/doodad/waterSource/StartSolarStill.ts index a69d9fb..eb48d7a 100644 --- a/src/objectives/other/doodad/waterSource/StartSolarStill.ts +++ b/src/objectives/other/doodad/waterSource/StartSolarStill.ts @@ -2,7 +2,7 @@ import type Doodad from "@wayward/game/game/doodad/Doodad"; import AttachContainer from "@wayward/game/game/entity/action/actions/AttachContainer"; import type Context from "../../../../core/context/Context"; -import type { IObjective, ObjectiveExecutionResult } from "../../../../core/objective/IObjective"; +import { ObjectiveResult, type IObjective, type ObjectiveExecutionResult } from "../../../../core/objective/IObjective"; import Objective from "../../../../core/objective/Objective"; import AcquireWaterContainer from "../../../acquire/item/specific/AcquireWaterContainer"; import MoveToTarget from "../../../core/MoveToTarget"; @@ -32,6 +32,10 @@ export default class StartSolarStill extends Objective { } public async execute(context: Context): Promise { + if (this.solarStill.tile.creature) { + return ObjectiveResult.Impossible; + } + const objectives: IObjective[] = [ // solar still tile must not have items on it new PickUpAllTileItems(this.solarStill.tile), diff --git a/src/objectives/other/doodad/waterSource/StartWaterStillDesalination.ts b/src/objectives/other/doodad/waterSource/StartWaterStillDesalination.ts index 945c416..6a493e9 100644 --- a/src/objectives/other/doodad/waterSource/StartWaterStillDesalination.ts +++ b/src/objectives/other/doodad/waterSource/StartWaterStillDesalination.ts @@ -118,6 +118,10 @@ export default class StartWaterStillDesalination extends Objective { if (!this.waterStill.stillContainer) { this.log.info("No still container"); + if (this.waterStill.tile.creature) { + return ObjectiveResult.Impossible; + } + if (availableWaterContainer === undefined) { objectives.push(new AcquireWaterContainer().keepInInventory()); }