1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 23:26:32 +09:00

Safety check

This commit is contained in:
lidgren
2010-06-19 10:50:11 +00:00
parent f65504518c
commit d843a5944a

View File

@@ -153,6 +153,8 @@ namespace Lidgren.Network
int numSends = msg.m_numSends;
float[] baseTimes = m_peerConfiguration.m_resendBaseTime;
float[] multiplers = m_peerConfiguration.m_resendRTTMultiplier;
if (numSends >= baseTimes.Length)
numSends = baseTimes.Length - 1;
msg.m_nextResendTime = now + baseTimes[numSends] + (m_averageRoundtripTime * multiplers[numSends]);
return (ushort)seqNr;