Skip to content

Conversation

RiftLurker
Copy link
Contributor

Fixes #120

@Josef37
Copy link

Josef37 commented Oct 6, 2022

@o4kapuk Is there a reason this still isn't merged?

@Josef37
Copy link

Josef37 commented Oct 6, 2022

Sorry for the rash question... 😅
I looked at the code and it seems that part would break:

engine/src/game/rooms.js

Lines 367 to 371 in 78d980e

objects.forEach(obj => {
if(lastPos.isNearTo(obj)) {
result = obj;
}
});

The current implementation checks if the final position of the path is near to a target which wouldn't work if that final position if further away...
Maybe inRangeTo would solve the problem, but then the result might not be distinct 🤔
I'll give it more thought later 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RoomPosition.findClosestByPath ignores range option - always uses range 1
3 participants