Ticket #35: fix_trac_35.patch

File fix_trac_35.patch, 923 bytes (added by ilag, 10 years ago)

Potential bugfix patch. Checks if nextmap is not empty. If not empty, it executes nextmap as normal. Else, it executes map_restart 5, restarting the map after five seconds.

  • code/game/g_main.c

    diff --git a/code/game/g_main.c b/code/game/g_main.c
    index 71e8318..70b5b3e 100644
    a b void ClearDuelData(qboolean all); 
    15801580void ExitLevel (void) {
    15811581        int             i;
    15821582        gclient_t *cl;
    1583 #ifndef SMOKINGUNS
    15841583        char nextmap[MAX_STRING_CHARS];
     1584#ifndef SMOKINGUNS
    15851585        char d1[MAX_STRING_CHARS];
    15861586#endif
    15871587
    void ExitLevel (void) { 
    16121612                trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap\n" );
    16131613        }
    16141614#else
    1615         trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap\n" );
     1615        trap_Cvar_VariableStringBuffer( "nextmap", nextmap, sizeof(nextmap) );
     1616    if ( Q_stricmp( nextmap , "" ) ){
     1617        trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap\n" );
     1618    } else {
     1619        Com_Printf("No nextmap specified!  Restarting current map in 5 seconds.\n");
     1620        trap_SendConsoleCommand( EXEC_APPEND, "map_restart 5\n" );
     1621    }
    16161622#endif
    16171623
    16181624        level.changemap = NULL;