Changes

no edit summary
Line 50: Line 50:  
local friendTypes = require('Module:Fleets/Names')
 
local friendTypes = require('Module:Fleets/Names')
   −
local function getFleetType(fleet, name)
+
local function getFleetType(fleet, event)
     for k, v in pairs(friendTypes[name] or {}) do
+
     local names = friendTypes[event] or {}
         for i, ship in ipairs(v) do
+
    if names[1] then
            if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then
+
        for i, o in ipairs(names) do
                 return k
+
            for i, ship in ipairs(o.ships) do
 +
                if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then
 +
                    return o.name
 +
                end
 +
            end
 +
        end
 +
    else
 +
         for name, ships in pairs(names) do
 +
            for i, ship in ipairs(ships) do
 +
                if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then
 +
                    return name
 +
                 end
 
             end
 
             end
 
         end
 
         end
cssedit, gkautomate
6,941

edits