Fix karts without a type
This commit is contained in:
parent
2620a77dc1
commit
324a93cd65
@ -66,8 +66,13 @@ AbstractKart::AbstractKart(const std::string& ident,
|
|||||||
m_characteristic->addCharacteristic(kart_properties_manager->
|
m_characteristic->addCharacteristic(kart_properties_manager->
|
||||||
getDifficultyCharacteristic(race_manager->getDifficultyAsString(
|
getDifficultyCharacteristic(race_manager->getDifficultyAsString(
|
||||||
race_manager->getDifficulty())));
|
race_manager->getDifficulty())));
|
||||||
m_characteristic->addCharacteristic(kart_properties_manager->
|
|
||||||
getKartTypeCharacteristic(m_kart_properties->getKartType()));
|
// Try to get the kart type
|
||||||
|
const AbstractCharacteristic *characteristic = kart_properties_manager->
|
||||||
|
getKartTypeCharacteristic(m_kart_properties->getKartType());
|
||||||
|
if (characteristic)
|
||||||
|
m_characteristic->addCharacteristic(characteristic);
|
||||||
|
|
||||||
m_characteristic->addCharacteristic(kart_properties_manager->
|
m_characteristic->addCharacteristic(kart_properties_manager->
|
||||||
getPlayerCharacteristic(KartProperties::getPerPlayerDifficultyAsString(
|
getPlayerCharacteristic(KartProperties::getPerPlayerDifficultyAsString(
|
||||||
m_difficulty)));
|
m_difficulty)));
|
||||||
|
@ -312,8 +312,17 @@ void KartProperties::combineCharacteristics()
|
|||||||
m_combined_characteristic = new CombinedCharacteristic();
|
m_combined_characteristic = new CombinedCharacteristic();
|
||||||
m_combined_characteristic->addCharacteristic(kart_properties_manager->
|
m_combined_characteristic->addCharacteristic(kart_properties_manager->
|
||||||
getBaseCharacteristic());
|
getBaseCharacteristic());
|
||||||
m_combined_characteristic->addCharacteristic(kart_properties_manager->
|
|
||||||
getKartTypeCharacteristic(m_kart_type));
|
// Try to get the kart type
|
||||||
|
const AbstractCharacteristic *characteristic = kart_properties_manager->
|
||||||
|
getKartTypeCharacteristic(m_kart_type);
|
||||||
|
if (!characteristic)
|
||||||
|
Log::warn("KartProperties", "Can't find kart type '%s' for kart '%s'",
|
||||||
|
m_kart_type.c_str(), m_name.c_str());
|
||||||
|
else
|
||||||
|
// Kart type found
|
||||||
|
m_combined_characteristic->addCharacteristic(characteristic);
|
||||||
|
|
||||||
m_combined_characteristic->addCharacteristic(m_characteristic);
|
m_combined_characteristic->addCharacteristic(m_characteristic);
|
||||||
} // combineCharacteristics
|
} // combineCharacteristics
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user