mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 00:06:16 +00:00
Avoid redundant per-frame calls to getDbValue32(toString("SERVER:CHARACTER_INFO:CHARACTERISTICS%d:VALUE", i))
This commit is contained in:
parent
2f6c264e7f
commit
cc6e271607
2 changed files with 7 additions and 2 deletions
|
@ -1978,7 +1978,11 @@ void CInterfaceManager::drawViews(NL3D::UCamera camera)
|
||||||
// Update Player characteristics (for Item carac requirement Redifying)
|
// Update Player characteristics (for Item carac requirement Redifying)
|
||||||
nlctassert(CHARACTERISTICS::NUM_CHARACTERISTICS==8);
|
nlctassert(CHARACTERISTICS::NUM_CHARACTERISTICS==8);
|
||||||
for (uint i=0; i<CHARACTERISTICS::NUM_CHARACTERISTICS; ++i)
|
for (uint i=0; i<CHARACTERISTICS::NUM_CHARACTERISTICS; ++i)
|
||||||
_CurrentPlayerCharac[i]= NLGUI::CDBManager::getInstance()->getDbValue32(toString("SERVER:CHARACTER_INFO:CHARACTERISTICS%d:VALUE", i));
|
{
|
||||||
|
NLMISC::CCDBNodeLeaf *node = _CurrentPlayerCharacLeaf[i] ? &*_CurrentPlayerCharacLeaf[i]
|
||||||
|
: (_CurrentPlayerCharacLeaf[i] = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:CHARACTER_INFO:CHARACTERISTICS%d:VALUE", i), false));
|
||||||
|
_CurrentPlayerCharac[i] = node ? node->getValue32() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
CWidgetManager::getInstance()->drawViews( camera );
|
CWidgetManager::getInstance()->drawViews( camera );
|
||||||
|
|
||||||
|
|
|
@ -634,6 +634,7 @@ private:
|
||||||
|
|
||||||
// Item Carac requirement
|
// Item Carac requirement
|
||||||
sint32 _CurrentPlayerCharac[CHARACTERISTICS::NUM_CHARACTERISTICS];
|
sint32 _CurrentPlayerCharac[CHARACTERISTICS::NUM_CHARACTERISTICS];
|
||||||
|
NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _CurrentPlayerCharacLeaf[CHARACTERISTICS::NUM_CHARACTERISTICS];
|
||||||
|
|
||||||
// observers for copying database branch changes
|
// observers for copying database branch changes
|
||||||
CServerToLocalAutoCopy ServerToLocalAutoCopyInventory;
|
CServerToLocalAutoCopy ServerToLocalAutoCopyInventory;
|
||||||
|
|
Loading…
Reference in a new issue