|
|
@ -295,22 +295,25 @@ void Player::forEachLoaded(std::function<void(Player *pl, Player *other)> func)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Player::sendToLoaded(mwmp::PlayerPacket *myPacket)
|
|
|
|
void Player::sendToLoaded(mwmp::PlayerPacket &myPacket)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::list <Player*> plList;
|
|
|
|
static std::set<Player*> plList;
|
|
|
|
|
|
|
|
static CellController::TContainer *addrCells = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (addrCells != &cells)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addrCells = &cells;
|
|
|
|
|
|
|
|
plList.clear();
|
|
|
|
for (auto &cell : cells)
|
|
|
|
for (auto &cell : cells)
|
|
|
|
for (auto &pl : *cell)
|
|
|
|
for (auto &pl : *cell)
|
|
|
|
plList.push_back(pl);
|
|
|
|
plList.insert(pl);
|
|
|
|
|
|
|
|
}
|
|
|
|
plList.sort();
|
|
|
|
|
|
|
|
plList.unique();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto pl : plList)
|
|
|
|
for (auto &pl : plList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pl == this) continue;
|
|
|
|
if (pl == this) continue;
|
|
|
|
myPacket->setPlayer(this);
|
|
|
|
myPacket.setPlayer(this);
|
|
|
|
myPacket->Send(pl->guid);
|
|
|
|
myPacket.Send(pl->guid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|