Changes

m
I understand my mistake
Line 63: Line 63:  
local equipment_type = self._equipment:type()
 
local equipment_type = self._equipment:type()
 
if equipment_icon == 16 then
 
if equipment_icon == 16 then
if self._equipment:aa() >= 8  then
+
local aa = self._equipment:aa()
 +
if  aa and aa >= 8  then
 
table.insert(self._categories, format{"Category:High-angle Guns with 8+ AA stat"})
 
table.insert(self._categories, format{"Category:High-angle Guns with 8+ AA stat"})
 
end
 
end
 
elseif equipment_type == 21 then
 
elseif equipment_type == 21 then
if self._equipment:aa() >= 9  then
+
local aa = self._equipment:aa()
 +
if  aa and aa >= 9  then
 
table.insert(self._categories, format{"Category:${equipment_type} with 9+ AA stat", equipment_type = Formatting:format_equipment_type_plural(equipment_type)})
 
table.insert(self._categories, format{"Category:${equipment_type} with 9+ AA stat", equipment_type = Formatting:format_equipment_type_plural(equipment_type)})
 
end
 
end
 
elseif equipment_type == 12 or equipment_type == 13 or equipment_type == 93 then
 
elseif equipment_type == 12 or equipment_type == 13 or equipment_type == 93 then
if self._equipment:aa() >= 2 then
+
local aa = self._equipment:aa()
 +
if aa and aa >= 2 then
 
table.insert(self._categories, format{"Category:Air Radars"})
 
table.insert(self._categories, format{"Category:Air Radars"})
 
end
 
end
if self._equipment:los() >= 5 then
+
local los = self._equipment:los()
 +
if los and los >= 5 then
 
table.insert(self._categories, format{"Category:Surface Radars"})
 
table.insert(self._categories, format{"Category:Surface Radars"})
 
end
 
end
Line 84: Line 88:  
end
 
end
 
end
 
end
if self._equipment:asw() >= 7 then
+
local asw = self._equipment:asw()
 +
if asw and asw >= 7 then
 
table.insert(self._categories, format{"Category:Aircraft with with 7+ ASW stat"})
 
table.insert(self._categories, format{"Category:Aircraft with with 7+ ASW stat"})
 
end
 
end
advmod, cssedit, Interface administrators, janitor, Moderators, prechecked, Widget editors
7,373

edits