Skip to content

Commit

Permalink
autosave characters every 30 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
goshhhy committed Nov 28, 2022
1 parent a54b93c commit 54513c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/characters/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const char* Time();
#define CURRENT_DATE s1 = Date()
#define CURRENT_TIME s2 = Time()

#define VRX_VERSION "5.1"
#define VRX_VERSION "5.2"

// autosave interval
#define AUTOSAVE_FRAMES (30*60)

//4.5 player combat preferences
#define HOSTILE_PLAYERS 0x00000001
Expand Down
7 changes: 6 additions & 1 deletion src/quake2/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ uint64_t qf2sf(uint64_t frames) {
================
G_RunFrame
Advances the world by 0.1 seconds
Advances the world by
================
*/

Expand Down Expand Up @@ -966,6 +966,11 @@ void G_RunFrame(void)
if (spawncycle < 130)
spawncycle = 130;

// autosave
if ( ( level.framenum % AUTOSAVE_FRAMES ) == 0 ) {
SV_SaveAllCharacters();
}

RunVotes();

ai_eval_targets(); // az
Expand Down

0 comments on commit 54513c8

Please sign in to comment.