Skip to content

Commit

Permalink
Update for 2.14.4-beta.dev.20241231.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetech committed Dec 31, 2024
1 parent 85d779f commit 6782a52
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 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.20241230.1",
"@wayward/types": "^2.14.4-beta.dev.20241231.1",
"rimraf": "3.0.2",
"typescript": "^5.7.2"
}
Expand Down
2 changes: 1 addition & 1 deletion src/TarsMod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default class TarsMod extends Mod {
this.globalSaveData.dataSlots = [];
}

Log.disableFileLogging(logSourceName);
Log.disableFileLoggingForSource(logSourceName);
}

public override onUninitialize(): void {
Expand Down
28 changes: 21 additions & 7 deletions src/utilities/MovementUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import PathOverlayFootPrints from "@wayward/game/ui/screen/screens/game/util/mov
import { Direction } from "@wayward/game/utilities/math/Direction";
import type { IVector3 } from "@wayward/game/utilities/math/IVector";
import { VehicleType } from "@wayward/game/game/item/IItem";
import { TileUpdateType } from "@wayward/game/game/IGame";

import Butcher from "@wayward/game/game/entity/action/actions/Butcher";
import Chop from "@wayward/game/game/entity/action/actions/Chop";
Expand Down Expand Up @@ -215,16 +216,29 @@ export class MovementUtilities {

if (nextTile.creature) {
// walking into a creature
context.log.info("Walking into a creature");

// ensure we are wearing the correct equipment
const handEquipmentChange = context.utilities.item.updateHandEquipment(context);
if (handEquipmentChange) {
context.log.info(`Going to equip ${handEquipmentChange.item} before attacking`);
if (!nextTile.creature.isTamed) {
// ensure we are wearing the correct equipment
const handEquipmentChange = context.utilities.item.updateHandEquipment(context);
if (handEquipmentChange) {
context.log.info(`Going to equip ${handEquipmentChange.item} before attacking`);

await context.utilities.action.executeAction(context, Equip, [handEquipmentChange.item, handEquipmentChange.equipType]);
}
await context.utilities.action.executeAction(context, Equip, [handEquipmentChange.item, handEquipmentChange.equipType]);
}

context.log.info("Walking into a creature");
} else if (!nextTile.creature.canSwapWith(context.human, undefined)) {
// issue with navigation nodes since canSwapWith might be cached due to a tile update
context.log.info("Creature is blocking movement");

const baseTiles = context.utilities.base.getBaseTiles(context);
const tile = nextTile.creature.tile;
if (tile) {
context.utilities.navigation.processTileUpdate(tile, tile.type, baseTiles.has(tile), TileUpdateType.Creature);
}

return MoveResult.NoPath;
}

await context.utilities.action.executeAction(context, Move, [direction]);

Expand Down

0 comments on commit 6782a52

Please sign in to comment.