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

Merged
merged 1 commit into from
Jan 28, 2025

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

@past-due past-due added this to the 4.6.0-beta1 milestone Jan 28, 2025
@past-due past-due merged commit a7e3e06 into Warzone2100:master Jan 28, 2025
37 checks passed
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.

2 participants