Skip to content

Commit a2267a1

Browse files
committed
Fixed warnings / errors.
1 parent 4fb9e1d commit a2267a1

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ void ConnectionManager::doRelay() {
477477
NetCommandList *cmdList = packet->getCommandList();
478478

479479
// Iterate through the commands in this packet and send them to the proper connections.
480-
for (NetCommandRef* cmd = cmdList->getFirstMessage(); cmd; cmd = cmd = cmd->getNext()) {
480+
for (NetCommandRef* cmd = cmdList->getFirstMessage(); cmd; cmd = cmd->getNext()) {
481481
//DEBUG_LOG(("ConnectionManager::doRelay() - Looking at a command of type %s",
482482
//GetNetCommandTypeAsString(cmd->getCommand()->getNetCommandType())));
483483

@@ -500,7 +500,7 @@ void ConnectionManager::doRelay() {
500500
}
501501

502502
NetCommandList *cmdList = m_netCommandWrapperList->getReadyCommands();
503-
for (NetCommandRef* cmd = cmdList->getFirstMessage(); cmd; cmd = cmd = cmd->getNext()) {
503+
for (NetCommandRef* cmd = cmdList->getFirstMessage(); cmd; cmd = cmd->getNext()) {
504504
if (CommandRequiresAck(cmd->getCommand())) {
505505
ackCommand(cmd, m_localSlot);
506506
}

Core/GameEngine/Source/GameNetwork/Transport.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,18 @@ Bool Transport::doRecv()
336336
// Latency simulation
337337
if (m_useLatency)
338338
{
339-
if (m_delayedInBuffer[i].message.length == 0)
339+
if (m_delayedInBuffer[bufferIndex].message.length == 0)
340340
{
341341
// Empty slot; use it
342-
m_delayedInBuffer[i].deliveryTime =
342+
m_delayedInBuffer[bufferIndex].deliveryTime =
343343
now + TheGlobalData->m_latencyAverage +
344344
(Int)(TheGlobalData->m_latencyAmplitude * sin(now * TheGlobalData->m_latencyPeriod)) +
345345
GameClientRandomValue(-TheGlobalData->m_latencyNoise, TheGlobalData->m_latencyNoise);
346-
m_delayedInBuffer[i].message.length = incomingMessage.length;
347-
m_delayedInBuffer[i].message.addr = ntohl(from.sin_addr.S_un.S_addr);
348-
m_delayedInBuffer[i].message.port = ntohs(from.sin_port);
349-
memcpy(&m_delayedInBuffer[i].message, buf, len);
346+
m_delayedInBuffer[bufferIndex].message.length = incomingMessage.length;
347+
m_delayedInBuffer[bufferIndex].message.addr = ntohl(from.sin_addr.S_un.S_addr);
348+
m_delayedInBuffer[bufferIndex].message.port = ntohs(from.sin_port);
349+
memcpy(&m_delayedInBuffer[bufferIndex].message, buf, len);
350+
++bufferIndex;
350351
break;
351352
}
352353
}

0 commit comments

Comments
 (0)