create new comms object if needed for non-first game

This commit is contained in:
ehouse 2005-04-03 01:36:59 +00:00
parent 6baa887b77
commit 712ec202d2
2 changed files with 10 additions and 4 deletions

View file

@ -103,8 +103,9 @@ game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
} /* game_makeNewGame */
void
game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XP_U16 gameID,
CommonPrefs* cp, TransportSend sendproc, void* closure )
game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XW_UtilCtxt* util,
XP_U16 gameID, CommonPrefs* cp, TransportSend sendproc,
void* closure )
{
XP_U16 i;
@ -122,6 +123,10 @@ game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XP_U16 gameID,
} else {
comms_reset( game->comms, gi->serverRole != SERVER_ISCLIENT );
}
} else if ( gi->serverRole != SERVER_STANDALONE ) {
game->comms = comms_make( MPPARM(mpool) util,
gi->serverRole != SERVER_ISCLIENT,
sendproc, closure );
}
#endif

View file

@ -75,8 +75,9 @@ typedef struct XWGame {
void game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
XW_UtilCtxt* util, DrawCtx* draw, XP_U16 gameID,
CommonPrefs* cp, TransportSend sendproc, void* closure);
void game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XP_U16 gameID,
CommonPrefs* cp, TransportSend sendproc, void* closure );
void game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XW_UtilCtxt* util,
XP_U16 gameID, CommonPrefs* cp, TransportSend sendproc,
void* closure );
void game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game,
CurGameInfo* gi,