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

JPS pathfinder crashes if destination is beyond room limits #523

Closed
ivan-mogilko opened this Issue Oct 21, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@ivan-mogilko
Copy link
Member

ivan-mogilko commented Oct 21, 2018

This does not happen all the time, but seem to usually occur when the character is already standing at the closest possible point to the room's edge. The crash is easily reproduced using following script:

function on_key_press(eKeyCode key)
{
    if (key == eKeySpace)
        player.Walk(-500, 0, eBlock, eWalkableAreas);
}

Keep calling it, and it will crash eventually (my game does on the second time).

Technically, the cause of crash is accessing a vector with negative index here:
https://github.com/adventuregamestudio/ags/blob/master/Engine/ac/route_finder_jps.inl#L623

@ivan-mogilko ivan-mogilko changed the title New pathfinder crashes if destination is beyond room limits JPS pathfinder crashes if destination is beyond room limits Oct 21, 2018

@ivan-mogilko ivan-mogilko added this to the 3.5.0 milestone Oct 22, 2018

@ivan-mogilko

This comment has been minimized.

Copy link
Member Author

ivan-mogilko commented Dec 14, 2018

Should be fixed with 9f64ee6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.