diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ec87bc331..e1eca3d62 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2555,7 +2555,7 @@ INT32 mapchangepending = 0; * \sa D_GameTypeChanged, Command_Map_f * \author Graue */ -void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean presetplayers, INT32 delay, boolean skipprecutscene, boolean pforcespecialstage) +void D_MapChange(UINT16 mapnum, INT32 newgametype, boolean pencoremode, boolean presetplayers, INT32 delay, boolean skipprecutscene, boolean pforcespecialstage) { static char buf[1+1+1+1+1+2+4]; static char *buf_p = buf; @@ -2594,7 +2594,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean p // new gametype value WRITEUINT8(buf_p, newgametype); - WRITEINT16(buf_p, mapnum); + WRITEUINT16(buf_p, mapnum); } if (delay == 1) @@ -2874,7 +2874,7 @@ static void Command_Map_f(void) if (first_option < 2) { /* I'm going over the fucking lines and I DON'T CAREEEEE */ - CONS_Printf("map [-gametype ] [-force]:\n"); + CONS_Printf("map [-gametype ] [-force]:\n"); CONS_Printf(M_GetText( "Warp to a map, by its name, two character code, with optional \"MAP\" prefix, or by its number (though why would you).\n" "All parameters are case-insensitive and may be abbreviated.\n")); @@ -3041,6 +3041,7 @@ static void Command_Map_f(void) D_MapChange(newmapnum, newgametype, newencoremode, newresetplayers, 0, false, newforcespecialstage); Z_Free(realmapname); + Z_Free(mapname); } /** Receives a map command and changes the map. @@ -3056,7 +3057,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) INT32 presetplayer = 1, lastgametype; UINT8 skipprecutscene, pforcespecialstage; boolean pencoremode, hasroundqueuedata; - INT16 mapnumber; + UINT16 mapnumber; forceresetplayers = deferencoremode = false; @@ -3130,7 +3131,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) if (!(gametyperules & GTR_ENCORE)) pencoremode = false; - mapnumber = READINT16(*cp); + mapnumber = READUINT16(*cp); // Handle some Grand Prix state. if (grandprixinfo.gp) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 908c6aec7..b765cf28e 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -239,7 +239,7 @@ void D_SendPlayerConfig(UINT8 n); void Command_ExitGame_f(void); void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore -void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pencoremode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pforcespecialstage); +void D_MapChange(UINT16 pmapnum, INT32 pgametype, boolean pencoremode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pforcespecialstage); void D_SetupVote(void); void D_ModifyClientVote(UINT8 player, SINT8 voted); void D_PickVote(void);