Skip to content

Commit

Permalink
Update for 2.14.4-beta.dev.20250106.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetech committed Jan 6, 2025
1 parent 9911de2 commit 457d3e0
Show file tree
Hide file tree
Showing 5 changed files with 29 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.4-beta.dev.20250105.1",
"@wayward/types": "^2.14.4-beta.dev.20250106.1",
"rimraf": "3.0.2",
"typescript": "^5.7.2"
}
Expand Down
20 changes: 15 additions & 5 deletions src/core/navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
6 changes: 5 additions & 1 deletion src/objectives/other/doodad/waterSource/StartSolarStill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -32,6 +32,10 @@ export default class StartSolarStill extends Objective {
}

public async execute(context: Context): Promise<ObjectiveExecutionResult> {
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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 457d3e0

Please sign in to comment.