math.bound #2896

Closed
opened 2022-10-20 14:00:49 +00:00 by AliasAlreadyTaken · 3 comments

The line

pattern:format(math.bound(1, steps - (alt_steps - step), steps))

creates this error, because there is no math.bound

2022-10-20 15:59:17: ERROR[Main]: ModError: Failed to load and run script from /home/ulrich/projects/minetest/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:
2022-10-20 15:59:17: ERROR[Main]: ...st-dev/bin/../mods/yl_commons/features/unified_crops.lua:370: attempt to call a nil value
2022-10-20 15:59:17: ERROR[Main]: stack traceback:
2022-10-20 15:59:17: ERROR[Main]: 	...st-dev/bin/../mods/yl_commons/features/unified_crops.lua:370: in main chunk
2022-10-20 15:59:17: ERROR[Main]: 	[C]: in function 'dofile'
2022-10-20 15:59:17: ERROR[Main]: 	...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:158: in function 'dofile'
2022-10-20 15:59:17: ERROR[Main]: 	...ev/minetest-dev/bin/../mods/yl_commons/features/init.lua:38: in main chunk
2022-10-20 15:59:17: ERROR[Main]: 	[C]: in function 'dofile'
2022-10-20 15:59:17: ERROR[Main]: 	...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:158: in function 'dofile'
2022-10-20 15:59:17: ERROR[Main]: 	...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:166: in main chunk

Should this line be

pattern:format(math.max(1, steps - (alt_steps - step), steps))

?

The line ``` pattern:format(math.bound(1, steps - (alt_steps - step), steps)) ``` creates this error, because there is no math.bound ``` 2022-10-20 15:59:17: ERROR[Main]: ModError: Failed to load and run script from /home/ulrich/projects/minetest/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua: 2022-10-20 15:59:17: ERROR[Main]: ...st-dev/bin/../mods/yl_commons/features/unified_crops.lua:370: attempt to call a nil value 2022-10-20 15:59:17: ERROR[Main]: stack traceback: 2022-10-20 15:59:17: ERROR[Main]: ...st-dev/bin/../mods/yl_commons/features/unified_crops.lua:370: in main chunk 2022-10-20 15:59:17: ERROR[Main]: [C]: in function 'dofile' 2022-10-20 15:59:17: ERROR[Main]: ...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:158: in function 'dofile' 2022-10-20 15:59:17: ERROR[Main]: ...ev/minetest-dev/bin/../mods/yl_commons/features/init.lua:38: in main chunk 2022-10-20 15:59:17: ERROR[Main]: [C]: in function 'dofile' 2022-10-20 15:59:17: ERROR[Main]: ...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:158: in function 'dofile' 2022-10-20 15:59:17: ERROR[Main]: ...t/5.6.0-dev/minetest-dev/bin/../mods/yl_commons/init.lua:166: in main chunk ``` Should this line be ``` pattern:format(math.max(1, steps - (alt_steps - step), steps)) ``` ?
AliasAlreadyTaken added the
1. kind/bug
label 2022-10-20 14:01:31 +00:00
Member

that's part of futil. i'm starting to regret the decision to follow minetest's lead in adding new functionality to table, string, and math.

that's part of futil. i'm starting to regret the decision to follow minetest's lead in adding new functionality to `table`, `string`, and `math`.
Member

also probably it was a mistake to make yl_commons (and other yl mods) depend on futil. i'll work on cleaning tha up today.

also probably it was a mistake to make yl_commons (and other yl mods) depend on futil. i'll work on cleaning tha up today.
flux self-assigned this 2022-10-20 16:31:57 +00:00
flux added this to the flux's TODO list project 2022-10-20 16:32:00 +00:00
flux added the
4. step/at work
label 2022-10-20 16:32:08 +00:00
Member

fixed in 25b7f80c5f

after 1.1.116 goes live, i'll work on your-land/administration#150 (cleanup the yl_* mods).

fixed in https://gitea.your-land.de/your-land/yl_commons/commit/25b7f80c5f12ea4d9e1b00dd4c81d04257f410da after 1.1.116 goes live, i'll work on https://gitea.your-land.de/your-land/administration/issues/150 (cleanup the yl_* mods).
flux closed this issue 2022-11-07 22:29:16 +00:00
flux added
5. result/fixed
and removed
4. step/at work
labels 2022-11-07 22:29:24 +00:00
flux removed this from the flux's TODO list project 2022-11-07 23:58:18 +00:00
flux removed their assignment 2022-11-07 23:58:22 +00:00
AliasAlreadyTaken added this to the 1.1.116 milestone 2022-11-08 13:01:13 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#2896
No description provided.