minetest-mods / hbsprint

A flexible sprint mod supporting stamina, hunger and monoids.
GNU Lesser General Public License v2.1
14 stars 11 forks source link

runtime error #20

Open ValkyrieStella opened 4 years ago

ValkyrieStella commented 4 years ago

I have been experiencing runtime errors on minetest 5.2 with the latest hbsprint mod:

2020-01-06 13:06:24: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'hbsprint' in callback environment_Step(): .../minetest/bin/../worlds/swue/worldmods/hbsprint/init.lua:105: attempt to index field 'tiles' (a nil value)
2020-01-06 13:06:24: ERROR[Main]: stack traceback:
2020-01-06 13:06:24: ERROR[Main]:       .../minetest/bin/../worlds/swue/worldmods/hbsprint/init.lua:105: in function 'create_particles'
2020-01-06 13:06:24: ERROR[Main]:       .../minetest/bin/../worlds/swue/worldmods/hbsprint/init.lua:192: in function <.../minetest/bin/../worlds/swue/worldmods/hbsprint/init.lua:144>
2020-01-06 13:06:24: ERROR[Main]:       /home/mt/minetest/bin/../builtin/game/register.lua:429: in function </home/mt/minetest/bin/../builtin/game/register.lua:413>
2020-01-06 13:06:24: ERROR[Main]: stack traceback:

EDIT by SmallJoker: Use three backticks for multiline code.

SmallJoker commented 4 years ago

Please check for updates. There is no tiles in L105. https://github.com/minetest-mods/hbsprint/blob/25472427e59899efa0b39cfad884dda03bacc06c/init.lua#L103-L107

EDIT: If that does not fix your issue, try to change this line https://github.com/minetest-mods/hbsprint/blob/25472427e59899efa0b39cfad884dda03bacc06c/init.lua#L127 to local tile = def.tiles and def.tiles[1] or def.inventory_image

verymilan commented 4 years ago

ftr my server ran into this at L134 now... didn't try suggested changes yet

ghost commented 3 years ago

Same Crash in my server:

2021-02-18 00:49:27: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod '' in callback environment_Step(): /home/minetest/minetest/bin/../mods/hbsprint/init.lua:134: attempt to index field 'tiles' (a nil value) 2021-02-18 00:49:27: ERROR[Main]: stack traceback: 2021-02-18 00:49:27: ERROR[Main]: /home/minetest/minetest/bin/../mods/hbsprint/init.lua:134: in function 'create_particles' 2021-02-18 00:49:27: ERROR[Main]: /home/minetest/minetest/bin/../mods/hbsprint/init.lua:246: in function 'sprint_step' 2021-02-18 00:49:27: ERROR[Main]: /home/minetest/minetest/bin/../mods/hbsprint/init.lua:257: in function </home/minetest/minetest/bin/../mods/hbsprint/init.lua:253> 2021-02-18 00:49:27: ERROR[Main]: /home/minetest/minetest/bin/../builtin/game/register.lua:426: in function </home/minetest/minetest/bin/../builtin/game/register.lua:410>

SmallJoker commented 3 years ago

@NathanielFreeman Should be fixed in f566d0f. Please report back if there are any similar/new issues in this regard.