From 287bc8d811ea22da532df4717f137bb9fe28eead Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 28 Jul 2013 05:10:06 +0200 Subject: [PATCH] Avoid redundant per-frame calls to getDbProp("SERVER:USER:DEFAULT_WEIGHT_HANDS") --- code/ryzom/client/src/interface_v3/sphrase_manager.cpp | 3 ++- code/ryzom/client/src/interface_v3/sphrase_manager.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index e056f62cb..9598bedec 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -1656,7 +1656,8 @@ float CSPhraseManager::getPhraseSumBrickProp(const CSPhraseCom &phrase, uint else if(propId==CSBrickManager::getInstance()->StaPropId && brick->Properties[j].PropId==CSBrickManager::getInstance()->StaWeightFactorId) { CInterfaceManager *im = CInterfaceManager::getInstance(); - uint32 weight = (uint32) NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEFAULT_WEIGHT_HANDS")->getValue32() / 10; // weight must be in dg here + if (!_ServerUserDefaultWeightHandsLeaf) _ServerUserDefaultWeightHandsLeaf = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEFAULT_WEIGHT_HANDS"); + uint32 weight = (uint32)(&*_ServerUserDefaultWeightHandsLeaf)->getValue32() / 10; // weight must be in dg here CDBCtrlSheet *ctrlSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestionsets:hands:handr")); if (ctrlSheet) { diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.h b/code/ryzom/client/src/interface_v3/sphrase_manager.h index 73d6a10b8..c14b584ab 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.h +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.h @@ -653,6 +653,8 @@ private: mutable NLMISC::CRefPtr _TotalMalusEquipLeaf; + NLMISC::CRefPtr _ServerUserDefaultWeightHandsLeaf; + // @} /// return the skill of the root