07-02-2015, 07:27 AM
I think the last "else" branch is wrong:
amount = math.random(0,2) if (amount ~= 0) then Pickups:Add(cItem(E_ITEM_POTATO, math.random(0,2)))This checks the amount, but then uses a new random number for the amount anyway; if that results in a zero, it might misbehave.