ElCeejo / animalia

Basic Fauna for Minetest Game
MIT License
14 stars 37 forks source link

Fix the behaviors.lua random function #55

Open slatian opened 1 year ago

slatian commented 1 year ago

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 commented 1 year ago

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