Fixed coprse bug

This commit is contained in:
2026-02-07 12:54:25 +11:00
parent 4b50e341a7
commit 02f850da35
12 changed files with 326 additions and 192 deletions

View File

@@ -97,11 +97,19 @@ describe('TargetingSystem', () => {
const enemyPos = { x: 3, y: 3 };
(getClosestVisibleEnemy as any).mockReturnValue(enemyPos);
const mockAccessor = {
getCombatant: vi.fn().mockReturnValue({
pos: playerPos,
inventory: { items: [{ id: 'item-1' }] }
}),
context: {}
};
targetingSystem.startTargeting(
'item-1',
playerPos,
mockWorld,
{} as any, // accessor
mockAccessor as any,
1 as EntityId, // playerId
new Uint8Array(100),
10
@@ -118,11 +126,19 @@ describe('TargetingSystem', () => {
const mousePos = { x: 5, y: 5 };
(getClosestVisibleEnemy as any).mockReturnValue(null);
const mockAccessor = {
getCombatant: vi.fn().mockReturnValue({
pos: playerPos,
inventory: { items: [{ id: 'item-1' }] }
}),
context: {}
};
targetingSystem.startTargeting(
'item-1',
playerPos,
mockWorld,
{} as any, // accessor
mockAccessor as any,
1 as EntityId, // playerId
new Uint8Array(100),
10,
@@ -143,12 +159,20 @@ describe('TargetingSystem', () => {
path: []
});
const mockAccessor = {
getCombatant: vi.fn().mockReturnValue({
pos: playerPos,
inventory: { items: [{ id: 'item-1' }] }
}),
context: {}
};
// Start targeting
targetingSystem.startTargeting(
'item-1',
playerPos,
mockWorld,
{} as any, // accessor
mockAccessor as any,
1 as EntityId,
new Uint8Array(100),
10,