Line 221: |
Line 221: |
| Ship = Ship or require(self._constructor_module) | | Ship = Ship or require(self._constructor_module) |
| return Ship:create_from_reference(self._cg_reference, self):cg() | | return Ship:create_from_reference(self._cg_reference, self):cg() |
− | end | + | else |
− | local api_id, simple_naming = self:api_id(), self:simple_naming()
| + | local api_id, simple_naming = self:api_id(), self:simple_naming() |
− | if api_id or simple_naming then
| + | if not api_id and not self:type() then |
− | return Formatting:ship_cg(api_id, self:unique_name(), self:type(), self._cg_extension, simple_naming)
| + | return Formatting:ship_cg(nil, self:unique_name(), nil, self._cg_extension, true) |
− | end
| + | elseif api_id or simple_naming then |
− | return self._cg
| + | return Formatting:ship_cg(api_id, self:unique_name(), self:type(), self._cg_extension, simple_naming) |
| + | end |
| + | end |
| end | | end |
| | | |
Line 235: |
Line 237: |
| Ship = Ship or require(self._constructor_module) | | Ship = Ship or require(self._constructor_module) |
| return Ship:create_from_reference(self._cg_damaged_reference, self):cg_damaged() | | return Ship:create_from_reference(self._cg_damaged_reference, self):cg_damaged() |
| + | else |
| + | local api_id, simple_naming = self:api_id(), self:simple_naming() |
| + | if not api_id and not self:type() then |
| + | return Formatting:ship_cg_damaged(nil, self:unique_name(), nil, self._cg_damaged_extension, true) |
| + | elseif api_id or simple_naming then |
| + | return Formatting:ship_cg_damaged(api_id, self:unique_name(), self:type(), self._cg_damaged_extension, simple_naming) |
| + | end |
| end | | end |
− | local api_id, simple_naming = self:api_id(), self:simple_naming()
| |
− | if api_id or simple_naming then
| |
− | return Formatting:ship_cg_damaged(api_id, self:unique_name(), self:type(), self._cg_damaged_extension, simple_naming)
| |
− | end
| |
− | return self._cg_damaged
| |
| end | | end |
| | | |