Skip to content

Commit

Permalink
fix(ship): Variant ships correctly inherit display names from base sh…
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGoodIdea authored Mar 9, 2024
1 parent 09d0562 commit 941639d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions source/Ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,18 +547,21 @@ void Ship::Load(const DataNode &node)
child.PrintTrace("Skipping unrecognized attribute:");
}

if(displayModelName.empty())
displayModelName = trueModelName;

// If no plural model name was given, default to the model name with an 's' appended.
// If the model name ends with an 's' or 'z', print a warning because the default plural will never be correct.
// Variants will import their plural name from the base model in FinishLoading.
if(pluralModelName.empty() && variantName.empty())
// Variants will import their display and plural names from the base model in FinishLoading.
if(variantName.empty())
{
pluralModelName = displayModelName + 's';
if(displayModelName.back() == 's' || displayModelName.back() == 'z')
node.PrintTrace("Warning: explicit plural name definition required, but none is provided. Defaulting to \""
if(displayModelName.empty())
displayModelName = trueModelName;

// If no plural model name was given, default to the model name with an 's' appended.
// If the model name ends with an 's' or 'z', print a warning because the default plural will never be correct.
if(pluralModelName.empty())
{
pluralModelName = displayModelName + 's';
if(displayModelName.back() == 's' || displayModelName.back() == 'z')
node.PrintTrace("Warning: explicit plural name definition required, but none is provided. Defaulting to \""
+ pluralModelName + "\".");
}
}
}

Expand Down

0 comments on commit 941639d

Please sign in to comment.