Skip to content

Commit

Permalink
engine: server: set mapname globals field before making first call in…
Browse files Browse the repository at this point in the history
…to DLL, as some mods tend to read it too early
  • Loading branch information
a1batross committed Dec 25, 2024
1 parent 48bdd42 commit 9811988
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/server/sv_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,15 +1606,17 @@ static int LoadGameState( char const *level, qboolean changelevel )
pSaveData = LoadSaveData( level );
if( !pSaveData ) return 0; // couldn't load the file

// must set mapname before calling into DLL
Q_strncpy( sv.name, level, sizeof( sv.name ));
svgame.globals->mapname = MAKE_STRING( sv.name );

ParseSaveTables( pSaveData, &header, true );
EntityPatchRead( pSaveData, level );

// pause until all clients connect
sv.loadgame = sv.paused = true;

Cvar_SetValue( "skill", header.skillLevel );
Q_strncpy( sv.name, header.mapName, sizeof( sv.name ));
svgame.globals->mapname = MAKE_STRING( sv.name );
Cvar_Set( "sv_skyname", header.skyName );

// restore sky parms
Expand Down

0 comments on commit 9811988

Please sign in to comment.