From 68e5d0979584d614868f790e2dcf4e5e186415b0 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 29 Dec 2005 17:47:47 +0000 Subject: Automatically initialise the address table Subversion-branch: /trunk/chocolate-doom Subversion-revision: 231 --- src/net_sdl.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/net_sdl.c b/src/net_sdl.c index 5eb26dfe..c202673f 100644 --- a/src/net_sdl.c +++ b/src/net_sdl.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: net_sdl.c 229 2005-10-30 19:56:15Z fraggle $ +// $Id: net_sdl.c 231 2005-12-29 17:47:47Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.2 2005/12/29 17:47:47 fraggle +// Automatically initialise the address table +// // Revision 1.1 2005/10/30 19:56:15 fraggle // Add foundation code for the new networking system // @@ -59,7 +62,7 @@ typedef struct } addrpair_t; static addrpair_t **addr_table; -static int addr_table_size; +static int addr_table_size = -1; // Initialises the address table @@ -87,6 +90,11 @@ static net_addr_t *NET_SDL_FindAddress(IPaddress *addr) int empty_entry = -1; int i; + if (addr_table_size < 0) + { + NET_SDL_InitAddrTable(); + } + for (i=0; i