So I've made a lua function that hides a player, but when he does this, all his summons disapears. How can I make so that the summons of a hidden player can still see the player? I have a table of the hidden players summons in the code that hides the player, but I dont know if its possible to make these summons still see the player. Here's the code:
Code:
void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* creature, bool known, uint32_t remove)
{
CreatureType_t creatureType = creature->getType();
const Player* otherPlayer = creature->getPlayer();
if (known) {
msg.add<uint16_t>(0x62);
msg.add<uint32_t>(creature->getID());
} else {
msg.add<uint16_t>(0x61);
msg.add<uint32_t>(remove);
msg.add<uint32_t>(creature->getID());
msg.AddByte(creatureType);
msg.AddString(creature->getName());
}
if (creature->isHealthHidden()) {
for (Creature* summon : creature->getSummons()) {
std::cout << "Name " << summon->getName() << std::endl;
// DO SOMETHING WITH SUMMONS SO THAT THEY CAN SEE MASTER
}
msg.AddByte(0x00);
} else {
msg.AddByte((int32_t)std::ceil(((float)creature->getHealth()) * 100 / std::max<int32_t>(creature->getMaxHealth(), 1)));
}