mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:19:55 +00:00
[Server] Send player speech and animation packets only to nearby players
This commit is contained in:
parent
2f4cd6b713
commit
1e2517698d
1 changed files with 8 additions and 6 deletions
|
@ -64,9 +64,10 @@ void DialogueFunctions::PlayAnimation(unsigned short pid, const char* groupname,
|
||||||
player->animation.count = count;
|
player->animation.count = count;
|
||||||
player->animation.persist = persist;
|
player->animation.persist = persist;
|
||||||
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_ANIM_PLAY)->setPlayer(player);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_ANIM_PLAY);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_ANIM_PLAY)->Send(false);
|
packet->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_ANIM_PLAY)->Send(true);
|
packet->Send(false);
|
||||||
|
player->sendToLoaded(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueFunctions::PlaySpeech(unsigned short pid, const char* sound) noexcept
|
void DialogueFunctions::PlaySpeech(unsigned short pid, const char* sound) noexcept
|
||||||
|
@ -76,7 +77,8 @@ void DialogueFunctions::PlaySpeech(unsigned short pid, const char* sound) noexce
|
||||||
|
|
||||||
player->sound = sound;
|
player->sound = sound;
|
||||||
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPEECH)->setPlayer(player);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPEECH);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPEECH)->Send(false);
|
packet->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPEECH)->Send(true);
|
packet->Send(false);
|
||||||
|
player->sendToLoaded(packet);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue