forked from mirror/openmw-tes3mp
[Server] Send actor packets only to players in the same cell
This commit is contained in:
parent
89ed318d3c
commit
fae3bcaeeb
2 changed files with 10 additions and 2 deletions
|
@ -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…
Reference in a new issue