Add joinable legacy code

This commit is contained in:
Cooldude2606
2024-09-23 23:01:52 +01:00
parent 2a1206c498
commit d24555d805
24 changed files with 144 additions and 126 deletions

View File

@@ -15,12 +15,12 @@ local function item_parse(input, _, reject)
local lower_input = input:lower():gsub(' ', '-')
-- Simple Case - internal name is given
local item = game.item_prototypes[lower_input]
local item = prototypes.item[lower_input]
if item then return item end
-- Second Case - rich text is given
local item_name = input:match('%[item=([0-9a-z-]+)%]')
item = game.item_prototypes[item_name]
item = prototypes.item[item_name]
if item then return item end
-- No item found, we do not attempt to search all prototypes as this will be expensive