[Server] Send actor packets only to players in the same cell

0.6.1
David Cernat 8 years ago
parent 89ed318d3c
commit fae3bcaeeb

@ -15,7 +15,11 @@ namespace mwmp
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
{
packet.Send(true);
// Send only to players who have the cell loaded
Cell *serverCell = CellController::get()->getCell(&event.cell);
if (serverCell != nullptr)
serverCell->sendToLoaded(&packet, &event);
Script::Call<Script::CallbackIdentity("OnActorFrame")>(player.getId(), event.cell.getDescription().c_str());
}

@ -15,7 +15,11 @@ namespace mwmp
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
{
packet.Send(true);
// Send only to players who have the cell loaded
Cell *serverCell = CellController::get()->getCell(&event.cell);
if (serverCell != nullptr)
serverCell->sendToLoaded(&packet, &event);
Script::Call<Script::CallbackIdentity("OnActorList")>(player.getId(), event.cell.getDescription().c_str());
}

Loading…
Cancel
Save