ElCeejo / animalia

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

change random(4) to random(0, 3) on crop sheet:4x4 for texture #104

Closed dontmindmehere closed 3 weeks ago

dontmindmehere commented 3 weeks ago

Texture modifier [[sheet:\<w>x\<h>:\<x>,\<y>](https://api.minetest.net/textures/#sheetwxhxy) takes 0-indexed x,y parameters, but math.random(4) will generate random numbers from 1 to 4, thus causing errors every time a "4" is created, for example:

2024-11-05 19:43:45: ERROR[Main]: generateImagePart(): invalid tile position (X,Y) for part_of_name="[sheet:4x4:4,4", cancelling.
2024-11-05 19:43:45: ERROR[Main]: generateImage(): Failed to generate "[sheet:4x4:4,4"
2024-11-05 19:43:48: ERROR[Main]: generateImagePart(): invalid tile position (X,Y) for part_of_name="[sheet:4x4:4,3", cancelling.
2024-11-05 19:43:48: ERROR[Main]: generateImage(): Failed to generate "[sheet:4x4:4,3"
dontmindmehere commented 3 weeks ago

oops, duplicate of #93