Skip to content

Commit

Permalink
Fixed: Net_AllocClientBuffers zeroed the entire client table
Browse files Browse the repository at this point in the history
This is obviously not right, especially when both callers go to the
trouble of configuring a specific client prior to calling...
  • Loading branch information
danij-deng committed Dec 10, 2011
1 parent 9cf1ff8 commit 74629ee
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions doomsday/engine/portable/src/net_main.c
Expand Up @@ -180,19 +180,20 @@ void Net_Register(void)

void Net_Init(void)
{
int i;

#if 0
// Local ticcmds are stored into this array before they're copied
// to netplayer[0]'s ticcmds buffer.
localticcmds = M_Calloc(LOCALTICS * TICCMD_SIZE);
numlocal = 0; // Nothing in the buffer.
#endif

{ int i;
for(i = 0; i < DDMAXPLAYERS; ++i)
{
memset(clients + i, 0, sizeof(clients[i]));
clients[i].viewConsole = -1;
}}
}

memset(&netBuffer, 0, sizeof(netBuffer));
netBuffer.headerLength = netBuffer.msg.data - (byte *) &netBuffer.msg;
Expand Down Expand Up @@ -518,15 +519,10 @@ void Net_BuildLocalCommands(timespan_t time)

void Net_AllocClientBuffers(int clientId)
{
int i;
if(clientId < 0 || clientId >= DDMAXPLAYERS) return;

memset(clients, 0, sizeof(clients));

for(i = 0; i < DDMAXPLAYERS; ++i)
{
// Movement smoother.
clients[i].smoother = Smoother_New();
}
// Movement smoother.
clients[clientId].smoother = Smoother_New();
}

void Net_DestroyArrays(void)
Expand Down

0 comments on commit 74629ee

Please sign in to comment.