diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-24 10:08:24 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-24 10:08:24 +0000 |
commit | 873dd0bfae9f9f78b3e978edb574e4793af7b03f (patch) | |
tree | f7e810bdf2ced2b13260e27418f5f94b7ceb2e84 /crawl-ref/source/acr.cc | |
parent | 89c4ddb91d7daef57c274e73747e3e3a82ea278b (diff) | |
download | crawl-ref-873dd0bfae9f9f78b3e978edb574e4793af7b03f.tar.gz crawl-ref-873dd0bfae9f9f78b3e978edb574e4793af7b03f.zip |
[1818767] Idle time clamped at 5 minutes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2534 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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)) { |