Skip to content

Commit

Permalink
Fix missing arrival when sending lords & donkeys (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
bob0005 authored Dec 24, 2024
1 parent 3b90c91 commit 17de40c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/hooks/helpers/use-resource-arrivals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import useNextBlockTimestamp from "../useNextBlockTimestamp";

const DONKEY_RESOURCE_TRACKER = 452312848583266388373324160190187140051835877600158453279131187530910662656n;
const LORDS_RESOURCE_TRACKER = 7237005577332262213973186563042994240829374041602535252466099000494570602496n;
const LORDS_AND_DONKEY_RESOURCE_TRACKER = 7689318425915528602346510723233181380881209919202693705745230188025481265152n;

export type ArrivalInfo = {
entityId: ID;
Expand Down Expand Up @@ -69,7 +70,9 @@ const usePlayerArrivals = () => {
// Check if entity has special resource types that don't need weight check
const hasSpecialResources =
ownedResourceTracker?.resource_types === DONKEY_RESOURCE_TRACKER ||
ownedResourceTracker?.resource_types === LORDS_RESOURCE_TRACKER;
ownedResourceTracker?.resource_types === LORDS_RESOURCE_TRACKER ||
ownedResourceTracker?.resource_types === LORDS_AND_DONKEY_RESOURCE_TRACKER;


// Determine if entity meets weight requirements
const meetsWeightRequirement = hasSpecialResources || hasMinWeight(id);
Expand All @@ -82,7 +85,6 @@ const usePlayerArrivals = () => {
// Check if entity has resources
const hasResources =
meetsWeightRequirement && !!ownedResourceTracker && ownedResourceTracker.resource_types !== 0n;

// Find matching player structure at position
const playerStructurePosition = playerStructurePositions.find(
(structurePosition) => structurePosition.x === position.x && structurePosition.y === position.y,
Expand Down

0 comments on commit 17de40c

Please sign in to comment.