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

Fix boundary check in script generated maps #4156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aco4
Copy link
Contributor

@aco4 aco4 commented Dec 19, 2024

The documentation for runMap_setMapData says:

//MAP-- `droids` is an array of droid data objects. Example:
//MAP--    {name: "ConstructionDroid", position: [x, y], direction: gameRand(0x10000), player: 1}
//MAP-- `features` is an array of feature data objects. Example:
//MAP--    {name: "Tree1", position: [x, y], direction: gameRand(0x10000)}

However, the code

gameRand(0x10000)

which generates a random value between 0 and 65535 (inclusive), would actually throw an error if it picks 65535. I fixed this

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

Successfully merging this pull request may close these issues.

1 participant