whiteblXK
Active Member
Hello, I wrote a short code in C ++ and I have a problem with it.
When I use this code in my function player and server(TFS 0.3.6) get big lags. How I should use getStorage and setStorage to work properly?
Code:
std::string strValue;
int32_t value = 1;
if(player->getStorage(uint32_t(6000 + player->getVocationId()), strValue) && atoi(strValue.c_str()) != value)
{
changeMaxHealth(uint32_t(getMaxHealth() + vocation->getBonusHP()));
changeMaxMana(uint32_t(getMaxMana() + vocation->getBonusMP()));
player->setStorage(uint32_t(6000 + player->getVocationId()), strValue);
}
When I use this code in my function player and server(TFS 0.3.6) get big lags. How I should use getStorage and setStorage to work properly?