From 8f36a2c1e8ce29f54d2ef924091bed87799e5cab Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 19:06:38 +0100 Subject: [PATCH] Changed: Some improvements (only try to fix wrong filenames if right files don't exist) --- .../client/src/interface_v3/character_3d.cpp | 42 ++++++++++++------- code/ryzom/client/src/player_cl.cpp | 42 ++++++++++++------- 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index 85eac6314..f9d4e36c2 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -458,27 +458,39 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo tmpName.replace(posBottes+7, 0, "_" + orgType); tmpName.replace(7, orgType.length(), "caster01"); - // temporary hack because Fyros boots don't respect conventions - if (tmpName[0] == 'f') - { - if (tmpName[5] == 'f') - { - tmpName = "fy_hof_caster01_bottes_civil.shape"; - } - else - { - tmpName = "fy_hom_caster01_civil01_bottes.shape"; - } - } - - // use fixed shape name only if file is present if (CPath::exists(tmpName)) { + // use fixed shape name only if file is present Parts[part].Name = tmpName; } else { - nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), Parts[part].Name.c_str()); + // temporary hack because Fyros light boots don't respect conventions + if (tmpName[0] == 'f' && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS)) + { + if (tmpName[5] == 'f') + { + tmpName = "fy_hof_caster01_bottes_civil.shape"; + } + else + { + tmpName = "fy_hom_caster01_civil01_bottes.shape"; + } + + // use fixed shape name only if file is present + if (CPath::exists(tmpName)) + { + Parts[part].Name = tmpName; + } + else + { + nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), Parts[part].Name.c_str()); + } + } + else + { + nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), Parts[part].Name.c_str()); + } } } } diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 20ac5e3b2..a086855ab 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -569,27 +569,39 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) tmpName.replace(posBottes+7, 0, "_" + orgType); tmpName.replace(7, orgType.length(), "caster01"); - // temporary hack because Fyros boots don't respect conventions - if (tmpName[0] == 'f') - { - if (tmpName[5] == 'f') - { - tmpName = "fy_hof_caster01_bottes_civil.shape"; - } - else - { - tmpName = "fy_hom_caster01_civil01_bottes.shape"; - } - } - - // use fixed shape name only if file is present if (CPath::exists(tmpName)) { + // use fixed shape name only if file is present shapeName = tmpName; } else { - nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), shapeName.c_str()); + // temporary hack because Fyros light boots don't respect conventions + if (tmpName[0] == 'f' && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS)) + { + if (tmpName[5] == 'f') + { + tmpName = "fy_hof_caster01_bottes_civil.shape"; + } + else + { + tmpName = "fy_hom_caster01_civil01_bottes.shape"; + } + + // use fixed shape name only if file is present + if (CPath::exists(tmpName)) + { + shapeName = tmpName; + } + else + { + nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), shapeName.c_str()); + } + } + else + { + nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), shapeName.c_str()); + } } } }