bricks42/Gene-Revolution — comment on commit 98729cd21f1e01810c249769ec21162cb3a90fcd
File: data/atomic_effects.lua line 24
By mfajer:

It took me a second to figure out what was going on here. I think it would be clearer to initialize it first and then loop over one less value of precision, like so:

eff.prob = Probability.new{val = prob.hit}
for i = 2, precision do
eff.prob = eff.prob / Probability.new{val = prob_hit}
end

If precision is 1 the for loop never executes (I just checked this).