Changes

Revision of new improvement data format for product initial level support
Line 287: Line 287:  
else
 
else
 
self._products_keys = false
 
self._products_keys = false
 +
end
 +
end
 +
 +
function EquipmentData:improvement_product_initial_level(product)
 +
if self._improvements and self._improvements._products and self._improvements._products[product] then
 +
return self._improvements._products[product]._stars
 
end
 
end
 
end
 
end
Line 295: Line 301:  
self._ships_keys = {}
 
self._ships_keys = {}
 
end
 
end
if not self._ships_keys[product] then
+
if not self._ships_keys[product] and self._improvements._products[product] then
 
self._ships_keys[product] = {}
 
self._ships_keys[product] = {}
for ship, _ in pairs(self._improvements._products[product]) do
+
for ship, _ in pairs(self._improvements._products[product]._ships) do
 
if type(ship) == "string" then
 
if type(ship) == "string" then
 
table.insert(self._ships_keys[product], ship)
 
table.insert(self._ships_keys[product], ship)
Line 303: Line 309:  
end
 
end
 
table.sort(self._ships_keys[product])
 
table.sort(self._ships_keys[product])
if self._improvements._products[product][true] then
+
if self._improvements._products[product]._ships[true] then
 
table.insert(self._ships_keys[product], 1, true)
 
table.insert(self._ships_keys[product], 1, true)
 
end
 
end
Line 338: Line 344:  
function EquipmentData:improvement_availability(product, ship)
 
function EquipmentData:improvement_availability(product, ship)
 
if self._improvements and self._improvements._products and self._improvements._products[product] then
 
if self._improvements and self._improvements._products and self._improvements._products[product] then
return self._improvements._products[product][ship]
+
return self._improvements._products[product]._ships[ship]
 
end
 
end
 
end
 
end
Anonymous user