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

TrashInterface does not validate cell types #60

Open
budnyric opened this issue Oct 17, 2023 · 1 comment
Open

TrashInterface does not validate cell types #60

budnyric opened this issue Oct 17, 2023 · 1 comment

Comments

@budnyric
Copy link
Contributor

This can lead to undefined behavior. From TrashInterface:
symbol_grid[y][x] = type_options[ grid.At(x,y) ].symbol;
The use of brackets here allows reading beyond the end of the array when illegal cell type ids are specified.
Suggestion: Change use of brackets to .at() to instead throw an exception if this occurs.

@amantham20
Copy link
Member

amantham20 commented Oct 25, 2023

adding on this, users can place an agent even on top of walls. Might need to throw an exception when initial starting point is on top of a wall

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

No branches or pull requests

2 participants