Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error in ClockwiseSweepPolygon _testCollision #7581

Closed
2 of 6 tasks
tposney opened this issue Jul 23, 2022 · 0 comments
Closed
2 of 6 tasks

[Bug]: Error in ClockwiseSweepPolygon _testCollision #7581

tposney opened this issue Jul 23, 2022 · 0 comments
Assignees
Labels
bug Functionality which is not working as intended lighting/fog Issues related to dynamic lighting or fog of war

Comments

@tposney
Copy link

tposney commented Jul 23, 2022

What happened?

I call canvas.walls.checkCollision(Ray) and if there are no collisions _testCollision throws an error

What ways of accessing Foundry can you encounter this issue in?

  • Native App (Electron)
  • Chrome
  • Firefox
  • Safari
  • Other

Reproduction Steps

If there are no collision _testCollision throws an error

let r = new Ray({x:0, y: 0}, {x: 100, y: 100});
canvas.walls.checkCollision(r);

causes

foundry.js:38822 Uncaught TypeError: Cannot read properties of undefined (reading 'type')

The relevant line is

    if ( collisions[0].type === CONST.WALL_SENSE_TYPES.LIMITED ) collisions.shift();

changing it to

    if ( collisions[0]?.type === CONST.WALL_SENSE_TYPES.LIMITED ) collisions.shift();

resolves the problem

What core version are you reporting this for?

Version 10 Testing 1 (build 274)

Relevant log output

foundry.js:38822 Uncaught TypeError: Cannot read properties of undefined (reading 'type')
[No packages detected]
    at ClockwiseSweepPolygon._testCollision (foundry.js:38822:24)
    at ClockwiseSweepPolygon.testCollision (foundry.js:28720:17)
    at WallsLayer.checkCollision (foundry.js:35985:37)
    at <anonymous>:2:14

Bug Checklist

  • The issue occurs while all Modules are disabled
@tposney tposney added the bug Functionality which is not working as intended label Jul 23, 2022
@aaclayton aaclayton self-assigned this Jul 23, 2022
@aaclayton aaclayton added the lighting/fog Issues related to dynamic lighting or fog of war label Jul 23, 2022
@aaclayton aaclayton added this to the Version 10 - Testing 2 milestone Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended lighting/fog Issues related to dynamic lighting or fog of war
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants