Skip to content

Commit

Permalink
server: handle "wait" delays during map startup, this should provide …
Browse files Browse the repository at this point in the history
…precise timings for server-side scripts as well
  • Loading branch information
ec- committed Oct 4, 2024
1 parent da163fa commit 5702d55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ static void SV_MapRestart_f( void ) {
// run a few frames to allow everything to settle
for ( i = 0; i < 3; i++ )
{
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
}
Expand Down Expand Up @@ -355,6 +356,7 @@ static void SV_MapRestart_f( void ) {
}

// run another frame to allow things to look at all the players
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
svs.time += 100;
Expand Down
2 changes: 2 additions & 0 deletions code/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {

// run a few frames to allow everything to settle
for ( i = 0; i < 3; i++ ) {
Cbuf_Wait();
sv.time += 100;
VM_Call( gvm, 1, GAME_RUN_FRAME, sv.time );
SV_BotFrame( sv.time );
Expand Down Expand Up @@ -601,6 +602,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
}

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

0 comments on commit 5702d55

Please sign in to comment.