separate internalization of comms from call to connect to relay since

the first must finish before the caller will have a valid reference to
comms.
This commit is contained in:
ehouse 2005-04-03 16:58:36 +00:00
parent de4af7c8ce
commit 0629dc5223

View file

@ -166,9 +166,12 @@ game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game,
#ifndef XWFEATURE_STANDALONE_ONLY
hasComms = stream_getU8( stream );
game->comms = hasComms?
comms_makeFromStream( MPPARM(mpool) stream, util, sendProc, closure ):
(CommsCtxt*)NULL;
if ( hasComms ) {
game->comms = comms_makeFromStream( MPPARM(mpool) stream, util, sendProc, closure );
comms_init( game->comms );
} else {
game->comms = NULL;
}
#endif
game->model = model_makeFromStream( MPPARM(mpool) stream, dict, util );