elkingahmed
New Member
- Joined
- May 31, 2012
- Messages
- 116
- Reaction score
- 2
im trying to change the currency of the house to gold nuggets from talkactions.cpp and its giving me this error {const is protected}
the code before edit:
after:
error:
thanks in advance
the code before edit:
Code:
if((uint32_t)g_game.getMoney(player) < house->getPrice() || !g_game.removeMoney(player, house->getPrice()))
{
player->sendCancel("You do not have enough money.");
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
return false;
}
after:
Code:
if(player->__getItemTypeCount(2157, -1) < house->getPrice() || !g_game.removeItemOfType(player, 2157, house->getPrice(), -1))
{
player->sendCancel("You do not have enough gold nuggets.");
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
return false;
}
error:
In file included from talkaction.h:23:0,
from talkaction.cpp:18:
player.h: In static member function 'static bool TalkAction::houseBuy(Creature*, const string&, const string&)':
player.h:1107:20: error: 'virtual uint32_t Player::__getItemTypeCount(uint16_t, int32_t) const' is protected
virtual uint32_t __getItemTypeCount(uint16_t itemId, int32_t subType = -1) const;
^
talkaction.cpp:562:43: error: within this context
if(player->__getItemTypeCount(2157, -1) < house->getPrice() || !g_game.removeItemOfType(player, 2157, house->getPrice(), -1))
^
thanks in advance