Skip to content

Fix the behaviors.lua random function#55

Open
slatian wants to merge 1 commit intoElCeejo:mainfrom
slatian:patch-1
Open

Fix the behaviors.lua random function#55
slatian wants to merge 1 commit intoElCeejo:mainfrom
slatian:patch-1

Conversation

@slatian
Copy link
Copy Markdown

@slatian slatian commented Jul 4, 2023

Sometimes the arguments to the random function in behaviors.lua are swapped because of negative coordinates, this commit introduces a wrapper for the random function which makes sure that math.random gets its arguments in the correct order.

Sometimes the arguments to the random function in behaviors.lua are swapped because of negative coordinates, this commit introduces a wrapper for the random function which makes sure that math.random gets its arguments in the correct order.
@appgurueu
Copy link
Copy Markdown

appgurueu commented Aug 18, 2023

An alternative, simpler fix is to simply swap the arguments (see #61); width will be positive. I also found another place where the range may be swapped (horses) which did need a "patched" random function.

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