Skip to content

Commit

Permalink
Don't increment sv.time before VM_Call (#96)
Browse files Browse the repository at this point in the history
Doing this causes timing issues with mapscripts since mapscript commands aren't executed immediately when level is loaded
  • Loading branch information
Aciz authored Mar 16, 2024
1 parent 0ddb47b commit fa765de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ static void SV_MapRestart_f( void ) {

// run a few frames to allow everything to settle
for ( i = 0; i < GAME_INIT_FRAMES; i++ ) {
sv.time += FRAMETIME;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
sv.time += FRAMETIME;
}

sv.state = SS_GAME;
Expand Down Expand Up @@ -437,8 +437,8 @@ static void SV_MapRestart_f( void ) {
}
}
// run another frame to allow things to look at all the players
sv.time += FRAMETIME;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
sv.time += FRAMETIME;
svs.time += FRAMETIME;

Cvar_Set( "sv_serverRestarting", "0" );
Expand Down
4 changes: 2 additions & 2 deletions src/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ void SV_SpawnServer( const char *mapname ) {
// run a few frames to allow everything to settle
for ( i = 0 ; i < GAME_INIT_FRAMES ; i++ )
{
sv.time += FRAMETIME;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
sv.time += FRAMETIME;
////SV_BotFrame (sv.time);
}

Expand Down Expand Up @@ -757,8 +757,8 @@ void SV_SpawnServer( const char *mapname ) {
}

// run another frame to allow things to look at all the players
sv.time += FRAMETIME;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
sv.time += FRAMETIME;
////SV_BotFrame( sv.time );
svs.time += FRAMETIME;

Expand Down

0 comments on commit fa765de

Please sign in to comment.