mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-10 00:43:27 +02:00
fix sometimes giving zero wood
This commit is contained in:
parent
899e5ec9cb
commit
8ad28a2ab5
@ -720,7 +720,7 @@ local function event_on_player_mined_entity(event)
|
|||||||
|
|
||||||
local baseamount = 4
|
local baseamount = 4
|
||||||
--minimum 1 wood
|
--minimum 1 wood
|
||||||
local amount = Math.clamp(1, Math.ceil(available), Math.ceil(baseamount * available/starting))
|
local amount = Math.clamp(1, Math.max(1, Math.ceil(available)), Math.ceil(baseamount * available/starting))
|
||||||
|
|
||||||
destination.dynamic_data.wood_remaining = destination.dynamic_data.wood_remaining - amount
|
destination.dynamic_data.wood_remaining = destination.dynamic_data.wood_remaining - amount
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user