mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 09:23:52 +00:00
[Server] Ensure no information exchange takes place with nullptr player
This commit is contained in:
parent
7f51ca5298
commit
ae37daca70
1 changed files with 24 additions and 16 deletions
|
@ -183,6 +183,13 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
player->forEachLoaded([this](Player *pl, Player *other) {
|
player->forEachLoaded([this](Player *pl, Player *other) {
|
||||||
|
|
||||||
|
if (other == nullptr)
|
||||||
|
{
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "- Tried to exchange information with nullptr!\n- Please report this to a developer",
|
||||||
|
other->npc.mName.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
LOG_APPEND(Log::LOG_INFO, "- Started information exchange with %s",
|
LOG_APPEND(Log::LOG_INFO, "- Started information exchange with %s",
|
||||||
other->npc.mName.c_str());
|
other->npc.mName.c_str());
|
||||||
|
|
||||||
|
@ -201,6 +208,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
LOG_APPEND(Log::LOG_INFO, "- Finished information exchange with %s",
|
LOG_APPEND(Log::LOG_INFO, "- Finished information exchange with %s",
|
||||||
other->npc.mName.c_str());
|
other->npc.mName.c_str());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
playerController->GetPacket(ID_PLAYER_POS)->Send(player);
|
playerController->GetPacket(ID_PLAYER_POS)->Send(player);
|
||||||
|
|
Loading…
Reference in a new issue