Network/ENetPeer: Fix crash

This commit is contained in:
Jérôme Leclercq 2017-02-17 17:30:27 +01:00
parent 902949549c
commit cc57fed42e
1 changed files with 2 additions and 4 deletions

View File

@ -271,7 +271,6 @@ namespace Nz
bool ENetPeer::CheckTimeouts(ENetEvent* event) bool ENetPeer::CheckTimeouts(ENetEvent* event)
{ {
UInt32 serviceTime = m_host->GetServiceTime(); UInt32 serviceTime = m_host->GetServiceTime();
bool timedOut = false;
auto it = m_sentReliableCommands.begin(); auto it = m_sentReliableCommands.begin();
for (; it != m_sentReliableCommands.end(); ++it) for (; it != m_sentReliableCommands.end(); ++it)
@ -288,8 +287,7 @@ namespace Nz
(command.roundTripTimeout >= command.roundTripTimeoutLimit && ENetTimeDifference(serviceTime, m_earliestTimeout) >= m_timeoutMinimum))) (command.roundTripTimeout >= command.roundTripTimeoutLimit && ENetTimeDifference(serviceTime, m_earliestTimeout) >= m_timeoutMinimum)))
{ {
m_host->NotifyDisconnect(this, event); m_host->NotifyDisconnect(this, event);
timedOut = true; return true;
break;
} }
if (command.packet) if (command.packet)
@ -316,7 +314,7 @@ namespace Nz
m_sentReliableCommands.erase(m_sentReliableCommands.begin(), it); m_sentReliableCommands.erase(m_sentReliableCommands.begin(), it);
return timedOut; return false;
} }
void ENetPeer::DispatchState(ENetPeerState state) void ENetPeer::DispatchState(ENetPeerState state)