fix declaration of 'i' hides previous local declaration

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7874 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5c30af5e9399a7ac5f7d5d8d8ece9d4372687e2e
Former-commit-id: d1a7a37fea51e276e92fd7f0e8d5676f350d6a15
This commit is contained in:
iobyte 2022-01-06 22:43:53 +00:00
parent f746f2f12f
commit bc62ef56e3

View file

@ -712,15 +712,15 @@ void NetNetwork::ReadCarStatusPacket(ENetPacket *pPacket)
status.time = packettime; status.time = packettime;
bool bFound = false; bool bFound = false;
for (unsigned int i=0;i<pNData->m_vecCarStatus.size();i++) for (size_t j=0;j<pNData->m_vecCarStatus.size();j++)
{ {
if (pNData->m_vecCarStatus[i].startRank == status.startRank) if (pNData->m_vecCarStatus[j].startRank == status.startRank)
{ {
bFound = true; bFound = true;
//Only use the data if the time is newer. Prevent out of order packet //Only use the data if the time is newer. Prevent out of order packet
if (pNData->m_vecCarStatus[i].time < status.time) if (pNData->m_vecCarStatus[j].time < status.time)
{ {
pNData->m_vecCarStatus[i] = status; pNData->m_vecCarStatus[j] = status;
} }
else else
{ {
@ -813,15 +813,15 @@ void NetNetwork::ReadCarControlsPacket(ENetPacket *pPacket)
ctrl.time = packettime; ctrl.time = packettime;
bool bFound = false; bool bFound = false;
for (unsigned int i=0;i<pNData->m_vecCarCtrls.size();i++) for (size_t j=0;j<pNData->m_vecCarCtrls.size();j++)
{ {
if (pNData->m_vecCarCtrls[i].startRank == ctrl.startRank) if (pNData->m_vecCarCtrls[j].startRank == ctrl.startRank)
{ {
bFound = true; bFound = true;
//Only use the data if the time is newer. Prevent out of order packet //Only use the data if the time is newer. Prevent out of order packet
if (pNData->m_vecCarCtrls[i].time < ctrl.time) if (pNData->m_vecCarCtrls[j].time < ctrl.time)
{ {
pNData->m_vecCarCtrls[i] = ctrl; pNData->m_vecCarCtrls[j] = ctrl;
} }
else else
{ {