Changes

fix for red links on Ship list
Line 304: Line 304:  
         aircraftTotal = 0
 
         aircraftTotal = 0
 
     end
 
     end
 +
   
 +
    --finding name of wiki page of ship
 +
    shipname = shipmodule.data[id]["name"][3]
 +
    shipbasename = mw.text.split(shipname, '%s')[1]
 +
    pagename = shipbasename
 +
    if string.sub(shipbasename,1,-2) == "Mist" then
 +
    if string.sub(shipbasename, -1) == '1' then
 +
    pagename = 'Iona_(fog)'
 +
    elseif string.sub(shipbasename, -1) == '2' then
 +
    pagename = 'Takao_(fog)'
 +
    elseif string.sub(shipbasename, -1) == '3' then
 +
    pagename = 'Haruna_(fog)'
 +
else
 +
pagename = 'Fleet of Fog'
 +
end
 +
end
    
     strings = strings .. '<td style="text-align: center;">' .. id .. '</td>'
 
     strings = strings .. '<td style="text-align: center;">' .. id .. '</td>'
     strings = strings .. '<td style="text-align: center;">[[' .. shipmodule.data[id]["name"][3] .. ']]</td>'
+
     strings = strings .. '<td style="text-align: center;">[[' .. pagename .. ']]</td>'
 
     strings = strings .. '<td style="text-align: center;">' .. shipmodule.data[id]["class"] .. '</td>'
 
     strings = strings .. '<td style="text-align: center;">' .. shipmodule.data[id]["class"] .. '</td>'
 
     strings = strings .. '<td style="text-align: center;">' .. shipmodule.data[id]["type"] .. '</td>'
 
     strings = strings .. '<td style="text-align: center;">' .. shipmodule.data[id]["type"] .. '</td>'
5,421

edits