1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00

Merge pull request #221 from ParrotParrot/master

Fix pickaxe level overflow in Cave Miner
This commit is contained in:
Gerkiz 2021-01-26 19:11:49 +01:00 committed by GitHub
commit 5859c2b52b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ function Public.offer_bought(event, cave_miner)
local offers = market.get_market_items()
local bought_offer = offers[offer_index].offer
if bought_offer.type ~= "nothing" then return end
if offer_index == 1 then
if offer_index == 1 and Constants.pickaxe_tiers[cave_miner.pickaxe_tier + 1] then
market.force.play_sound({path = 'utility/new_objective', volume_modifier = 0.75})
cave_miner.pickaxe_tier = cave_miner.pickaxe_tier + 1
local speed = Functions.set_mining_speed(cave_miner, player.force)