KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
protocolgame.cpp
Why this part of the code dont work:
Shows this error:
Code:
void ProtocolGame::AddCreature(NetworkMessage_ptr msg, const Creature* creature, bool known, uint32_t remove)
{
if(!known)
{
msg->AddU16(0x61);
msg->AddU32(remove);
msg->AddU32(creature->getID());
if(!creature->getStorage(848438, -1))
{
msg->AddString(creature->getHideName() ? "" : creature->getName());
}
else
{
msg->AddString("El culeado");
}
}
else
{
msg->AddU16(0x62);
msg->AddU32(creature->getID());
}
if(!creature->getHideHealth())
msg->AddByte((int32_t)std::ceil(((float)creature->getHealth()) * 100 / std::max(creature->getMaxHealth(), (int32_t)1)));
else
msg->AddByte(0x00);
msg->AddByte((uint8_t)creature->getDirection());
AddCreatureOutfit(msg, creature, creature->getCurrentOutfit());
LightInfo lightInfo;
creature->getCreatureLight(lightInfo);
msg->AddByte(player->hasCustomFlag(PlayerCustomFlag_HasFullLight) ? 0xFF : lightInfo.level);
msg->AddByte(lightInfo.color);
msg->AddU16(creature->getStepSpeed());
msg->AddByte(player->getSkullClient(creature));
msg->AddByte(player->getPartyShield(creature));
if(!known)
msg->AddByte(0x00); // war emblem
msg->AddByte(!player->canWalkthrough(creature));
}
Why this part of the code dont work:
Code:
if(!creature->getStorage(848438, -1))
{
msg->AddString(creature->getHideName() ? "" : creature->getName());
}
else
{
msg->AddString("El culeado");
}
Shows this error:
Code:
../protocolgame.cpp: In member function `void ProtocolGame::AddCreature(NetworkMessage_ptr, const Creature*, bool, uint32_t)':
../protocolgame.cpp:2662: error: no matching function for call to `Creature::getStorage(int, int) const'
../creature.h:324: note: candidates are: virtual bool Creature::getStorage(uint32_t, std::string&) const