• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 57: Line 57:  
function Ship:get_table(name, model)
 
function Ship:get_table(name, model)
 
local success, ship_table = U.requireModule(name)
 
local success, ship_table = U.requireModule(name)
 +
local ship_form_table
 
if success then
 
if success then
ship_table = ship_table[model]
+
ship_form_table = ship_table[model]
if type(ship_table) == "string" then
+
if not ship_form_table and ship_table.seasonals then
ship_table = self:get_table(self:process_ship_key_as_reference(ship_table, name))
+
            ship_form_table = U.ifindBy(ship_table.seasonals, function(data) return data._suffix == model end)
 +
        end
 +
if type(ship_form_table) == "string" then
 +
ship_form_table = self:get_table(self:process_ship_key_as_reference(ship_form_table, name))
 
    end
 
    end
 
     end
 
     end
if not ship_table then
+
if not ship_form_table then
ship_table = { _name = name, _suffix = model }
+
ship_form_table = { _name = name, _suffix = model }
 
end
 
end
if ship_table._name == nil then
+
if ship_form_table._name == nil then
    ship_table._name = name
+
    ship_form_table._name = name
 
     end
 
     end
if ship_table._suffix == nil then
+
if ship_form_table._suffix == nil then
    ship_table._suffix = model
+
    ship_form_table._suffix = model
 
     end
 
     end
return ship_table
+
return ship_form_table
 
end
 
end
  
cssedit, gkautomate
7,064

edits

Navigation menu