witam mam problem i za bardzo nie ogarniam jak to naprawić
protocol76.cpp: In member function 'void Protocol76::parseLookAt(NetworkMessage&)':
protocol76.cpp:1438:80: error: no matching function for call to 'House::getDescription()'
protocol76.cpp:1438:80: note: candidate is:
In file included from player.h:13:0,
from spells.h:6,
from game.h:19,
from protocol.h:5,
from protocol76.h:5,
from protocol76.cpp:8:
houses.h:46:14: note: std::string House::getDescription(uint32_t) const
houses.h:46:14: note: candidate expects 1 argument, 0 provided
void Protocol76::parseLookAt(NetworkMessage &msg)
{
Position LookPos = msg.GetPosition();
uint16_t ItemNum = msg.GetU16();
uint8_t stackpos = msg.GetByte();
NetworkMessage newmsg;
std::stringstream ss;
Item *item = nullptr;
Creature *creature = nullptr;
OTSYS_THREAD_LOCK_CLASS lockClass(game->gameLock, "Protocol76::parseLookAt()");
if(LookPos.x != 0xFFFF) {
Tile* tile = game->getTile(LookPos.x, LookPos.y, LookPos.z);
if(tile){
item = dynamic_cast<Item*>(tile->getTopThing());
creature = dynamic_cast<Creature*>(tile->getTopThing());
}
}
else {
//from container/inventory
if(LookPos.y & 0x40) {
unsigned char from_cid = LookPos.y & 0x0F;
unsigned char slot = LookPos.z;
Container *parentcontainer = player->getContainer(from_cid);
if(!parentcontainer)
return;
item = parentcontainer->getItem(slot);
}
else {
unsigned char from_cid = static_cast<unsigned char>(LookPos.y);
item = player->getItem(from_cid);
}
}
Player *toPlayer = dynamic_cast<Player*>(creature);
if((item && (!toPlayer)) || (item && toPlayer && toPlayer != player && toPlayer->access > player->access && toPlayer->gmInvisible))
{
Tile* doorTile = game->getTile(LookPos);
Thing* doorThing = doorTile? doorTile->getTopThing() : nullptr;
Item* doorItem = doorThing? dynamic_cast<Item*>(doorThing) : nullptr;
if (doorItem && Item::items[doorItem->getID()].isDoor && doorTile && doorTile->getHouse())
AddTextMessage(newmsg, MSG_INFO_DESCR, doorTile->getHouse()->getDescription().c_str());
else
{
bool fullDescription = false;
if(LookPos.x == 0xFFFF) {
fullDescription = true;
}
else if(std::abs(player->pos.x - LookPos.x) <= 1 && std::abs(player->pos.y - LookPos.y) <= 1 &&
LookPos.z == player->pos.z) {
fullDescription = true;
}
std::stringstream ss;
ss << "You see " << item->getDescription(fullDescription);
if (player->access >= g_config.ACCESS_LOOK)
ss << "\nId: " << Item::items.reverseLookUp(ItemNum)
<< ". Pos: " << LookPos.x << ' ' << LookPos.y << ' ' << LookPos.z << '.';
AddTextMessage(newmsg,MSG_INFO_DESCR, ss.str().c_str());
}
}
else if(creature) {
if(player == creature) {
std::stringstream ss;
ss << "You see " << creature->getDescription(true);
AddTextMessage(newmsg,MSG_INFO_DESCR, ss.str().c_str());
}
#ifdef _BBK_GM_INVISIBLE
else
{
Player* gm = dynamic_cast<Player*>(creature);
if(gm && gm->gmInvisible && player->access < g_config.ACCESS_PROTECT)
{
std::stringstream ss;
Tile* tile = game->getTile(gm->pos);
if(tile)
{
Item *item = tile->getTopTopItem();
if(item)
{
ss << "You see " << item->getDescription(true);
}
else
{
Item *thing = dynamic_cast<Item*>(tile->getTopDownItem());
if(thing)
ss << "You see " << thing->getDescription(true);
else
ss << "You see " << tile->ground->getDescription(true);
}
}
else
ss << "Yyy..";
AddTextMessage(newmsg,MSG_INFO_DESCR, ss.str().c_str());
}
else
{
std::stringstream ss;
ss << "You see " << creature->getDescription().c_str();
AddTextMessage(newmsg,MSG_INFO_DESCR, ss.str().c_str());
}
}
}
#else
else
{
std::stringstream ss;
ss << "You see " << creature->getDescription().c_str();
AddTextMessage(newmsg,MSG_INFO_DESCR, ss.str().c_str());
}
}
#endif //_BBK_GM_INVISIBLE
sendNetworkMessage(&newmsg);
}