• 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 75: Line 75:     
function Ship:process_ship_key(ship_key)
 
function Ship:process_ship_key(ship_key)
 +
    -- [[Category:Todo]]: rfind?
 
local split = mw.ustring.find(ship_key, '/')
 
local split = mw.ustring.find(ship_key, '/')
 
local ship_base_name, ship_suffix
 
local ship_base_name, ship_suffix
Line 80: Line 81:  
ship_base_name = ship_key
 
ship_base_name = ship_key
 
else
 
else
ship_base_name = split - 1 > 0 and mw.ustring.sub(ship_key, 1, split - 1) or ''
+
    local split2 = mw.ustring.find(ship_key, '/', split + 1)
ship_suffix = mw.ustring.sub(ship_key, split + 1, -1)
+
    if split2 == nil then
 +
    ship_base_name = split - 1 > 0 and mw.ustring.sub(ship_key, 1, split - 1) or ''
 +
    ship_suffix = mw.ustring.sub(ship_key, split + 1, -1)
 +
else
 +
    ship_base_name = split2 - 1 > 0 and mw.ustring.sub(ship_key, 1, split2 - 1) or ''
 +
    ship_suffix = mw.ustring.sub(ship_key, split2 + 1, -1)
 +
end
 
end
 
end
 
return ship_base_name, ship_suffix
 
return ship_base_name, ship_suffix
cssedit, gkautomate
6,926

edits

Navigation menu