Fixed heavy repitition

- Introduced EmmyLua documentation (can be removed if needed)
- Remamed type to inv
This commit is contained in:
badgamernl
2020-09-03 03:33:39 +02:00
parent ecadbd6534
commit f149e446a1
2 changed files with 90 additions and 131 deletions

View File

@@ -4,12 +4,12 @@
@alias autofill
]]
local Game = require 'utils.game' --- @dep utils.game
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Global = require 'utils.global' --- @dep utils.global
local config = require 'config.gui.autofill' --- @dep config.gui.autofill
local Event = require 'utils.event' --- @dep utils.event
local table = require 'overrides.table' --- @dep overrides.table
local Game = require 'utils.game' -- @dep utils.game
local Gui = require 'expcore.gui' -- @dep expcore.gui
local Global = require 'utils.global' -- @dep utils.global
local config = require 'config.gui.autofill' -- @dep config.gui.autofill
local Event = require 'utils.event' -- @dep utils.event
local table = require 'overrides.table' -- @dep overrides.table
local print_text = Game.print_floating_text -- (surface, position, text, color)
@@ -333,7 +333,7 @@ local function entity_build(event)
if not item.enabled then goto end_item end
-- Get the inventory of the entity or goto next item
local entity_inventory = entity.get_inventory(item.type)
local entity_inventory = entity.get_inventory(item.inv)
if not entity_inventory then goto end_item end
local preferd_amount = item.amount