From 8407c1357d8e3b2cb7404f0234131b7e8d3a907d Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 29 Jan 2025 00:43:43 +0900 Subject: [PATCH] . --- exp_scenario/module/commands/waterfill.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exp_scenario/module/commands/waterfill.lua b/exp_scenario/module/commands/waterfill.lua index d47eb8fc..9bb7e8d0 100644 --- a/exp_scenario/module/commands/waterfill.lua +++ b/exp_scenario/module/commands/waterfill.lua @@ -74,11 +74,13 @@ Selection.on_selection(SelectionName, function(event) if item_count_cliff >= t_diff then player.remove_item{ name = "cliff-explosives", count = t_diff } else - local item_count_needed = t_diff - item_count_cliff player.remove_item{ name = "cliff-explosives", count = item_count_cliff } - player.remove_item{ name = "explosives", count = 10 * item_count_needed } - player.remove_item{ name = "barrel", count = item_count_needed } - player.remove_item{ name = "grenade", count = item_count_needed } + local item_count_needed = t_diff - item_count_cliff + if item_count_needed > 0 then + player.remove_item{ name = "explosives", count = 10 * item_count_needed } + player.remove_item{ name = "barrel", count = item_count_needed } + player.remove_item{ name = "grenade", count = item_count_needed } + end end if remaining_tiles > 0 then