diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/AppHdr.h | 5 | ||||
-rw-r--r-- | crawl-ref/source/acr.cc | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index 7c9fab97d6..66e1fecdd8 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -224,7 +224,9 @@ #endif // Increase the size of the topscores file for public servers. + #ifndef SCORE_FILE_ENTRIES #define SCORE_FILE_ENTRIES 1000 + #endif // If defined, the hiscores code dumps preformatted verbose and terse // death message strings in the logfile for the convenience of logfile @@ -322,6 +324,9 @@ // number of back messages saved during play (currently none saved into files) #define NUM_STORED_MESSAGES 1000 +// clamp time between command inputs at 5 minutes when reporting play time. +#define IDLE_TIME_CLAMP (5 * 60) + // Uncomment this if you find the labyrinth to be buggy and want to // remove it from the game. // #define SHUT_LABYRINTH diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 16e88232ef..47a6e02eb2 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3034,7 +3034,18 @@ static command_type get_next_cmd() #if DEBUG_ITEM_SCAN debug_item_scan(); #endif + + const time_t before = time(NULL); keycode_type keyin = get_next_keycode(); + + const time_t after = time(NULL); + + // Clamp idle time so that play time is more meaningful. + if (after - before > IDLE_TIME_CLAMP) + { + you.real_time += (before - you.start_time) + IDLE_TIME_CLAMP; + you.start_time = after; + } if (is_userfunction(keyin)) { |