minertools: fix incorrect mineralfinder stone indexing.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
This commit is contained in:
Michal Cieslakiewicz 2018-10-07 15:29:16 +02:00
parent 7ba50dcf2c
commit 98867c7cd8

View File

@ -339,7 +339,7 @@ end
function minertools.mineralfinder_switch_ore(label, player_name,
stones_list, stone_index)
play_click(player_name)
local new_stone_idx = (( stone_index + 1 ) % #stones_list) + 1
local new_stone_idx = (stone_index % #stones_list) + 1
minertools.print_mineral_type_set_to(label, player_name,
stones_list[new_stone_idx])
return new_stone_idx