From 15a8590a760e554930e98bdcfed462ce7495e50e Mon Sep 17 00:00:00 2001 From: Wyrrrd Date: Mon, 19 Apr 2021 23:42:11 +0200 Subject: [PATCH] Some quick fixes --- .gitignore | 1 + control.lua | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c4c4ffc..663505a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.zip +.vscode/* diff --git a/control.lua b/control.lua index 079a7c1..aabe8e4 100644 --- a/control.lua +++ b/control.lua @@ -87,13 +87,13 @@ script.on_nth_tick(600, function (event) if entity.valid and entity.force == player.force then local inventory - if entity.type == "ammo-turret" and turret_enabled then + if turret_enabled and entity.type == "ammo-turret" then inventory = entity.get_inventory(defines.inventory.turret_ammo) - elseif entity.type == "car" and car_enabled then + elseif car_enabled and entity.type == "car" and entity.prototype.guns then inventory = entity.get_inventory(defines.inventory.car_ammo) end - local no, low + local no, low = false if inventory and get_ammo_flags[mode] then if entity.type == "ammo-turret" then no, low = get_ammo_flags[mode](inventory)