Sorry, it seems I double-posted and now I can't change the title of this post. Anyway, I've got a second crash:
The mod Golf (0.1.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event golf::on_player_used_capsule (ID 76)
__golf__/control.lua:397: attempt to index global 'ball' (a nil value)
stack traceback:
__golf__/control.lua:397: in function 'hit_nearest_ball'
__golf__/control.lua:449: in function <__golf__/control.lua:408>
This is the crashing line:
hit_counts[ball.unit_number] = hit_counts[ball.unit_number] + 1
However, you get the closest ball with
local the_chosen_one, _ = find_closest_ball(player,ball_hit_range)
while ball
is never defined in function hit_nearest_ball
. It looks like you renamed ball
to the_chosen_one
at some point, but forgot to change that name in line 397.