Changes

m
no edit summary
Line 124: Line 124:  
        --Fleets are of variable size, so we append onto a string until we hit the next node declaration
 
        --Fleets are of variable size, so we append onto a string until we hit the next node declaration
 
        local split = mw.ustring.find(item_key, '/')
 
        local split = mw.ustring.find(item_key, '/')
        local ship_name = mw.ustring.sub(item_key, 1, split - 1)
+
        local ship_name, ship_suffix
        local ship_suffix = mw.ustring.sub(item_key, split + 1)
+
        if split then
 +
            ship_name = mw.ustring.sub(item_key, 1, split - 1)
 +
            ship_suffix = mw.ustring.sub(item_key, split + 1)
 +
        else
 +
            ship_name = item_key
 +
            ship_suffix = ""
 +
        end
 
        local ship = EnemyShip(ship_name, ship_suffix)
 
        local ship = EnemyShip(ship_name, ship_suffix)
 
         
 
         
48

edits