I am updating my game, and adding rebirths 6-8. When I just add the bunker unlock to the table, the tycoon works fine. However, if I add 1+ more to the table after that, the entire tycoon system breaks. Everything is typed out properly, is there something I should know about tables here?
Alright, well here’s all the relevant code that calls the table:
for u = 1,#unlockPurchases,1 do
unlock[u] = {rebirthCount = unlockPurchases[u].rebirthCount}
table.insert(unlock[u],unlockPurchases[u].unlock)
addDependencies(unlock[u],unlockPurchases[u].unlock)
and
PlayerStatManager:IncrementStat(player,"RebirthCount",1)
rebirthCountStat = PlayerStatManager:getStat(player,"RebirthCount")
for u = 1,#unlockPurchases,1 do
if rebirthCountStat >= unlockPurchases[u].rebirthCount then
PlayerStatManager:ChangeStatInTycoonPurchases(player, unlockPurchases[u].unlock, true)
end
end
callFunctionsIfRebirthIsReached(rebirthCountStat,player)
for index, unlock_purchase in ipairs(unlockPurchases) do
unlock[index] = unlock_purchase.unlock
addDependencies(unlock[index],unlock_purchase.unlock)
end