From 9de48d82595b504e67224e04114e07e036884ce6 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 1 Aug 2021 11:13:13 +0200 Subject: [PATCH] Fix ta2_winch bug --- ta2_energy_storage/ta2_winch.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ta2_energy_storage/ta2_winch.lua b/ta2_energy_storage/ta2_winch.lua index d246a4b..c666ccd 100644 --- a/ta2_energy_storage/ta2_winch.lua +++ b/ta2_energy_storage/ta2_winch.lua @@ -56,7 +56,7 @@ end local function add_chest_entity(pos, nvm) local mem = techage.get_mem(pos) - local length = (nvm.length or MAX_ROPE_LEN) * (1 - nvm.load/nvm.capa) + local length = (nvm.length or MAX_ROPE_LEN) * (1 - (nvm.load or 0) / (nvm.capa or 1)) local y = pos.y - length - 1 techage.renew_rope(pos, length, true) if mem.obj then