summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-19 07:58:41 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-19 07:58:41 +0000
commitfc1772e8178923ba4ff088e8e2b6a9da4363ecf5 (patch)
tree2493294dcda8f64cd7bb2fdaa4f23c2089297c0e /crawl-ref/source
parent432b2bd31252bab2a86af122657dcb82e724344f (diff)
downloadcrawl-ref-fc1772e8178923ba4ff088e8e2b6a9da4363ecf5.tar.gz
crawl-ref-fc1772e8178923ba4ff088e8e2b6a9da4363ecf5.zip
For debug test explore, moving through shallow water can make the
detailed turns-and-elapsed-time-by-branch information (PlaceInfo) not add up, causing an assertion when the savefile is loaded. Fixed simply by forcing the numbers to add up, since introducing innacuracies into this when debug testing shouldn't be a problem. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3093 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/debug.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 35ef06024d..4d30d887a3 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -3367,6 +3367,18 @@ static int debug_time_explore()
you.num_turns++;
}
+ // Elapsed time might not match up if explore had to go through
+ // shallow water.
+ PlaceInfo& pi = you.get_place_info();
+ pi.elapsed_total = (pi.elapsed_explore + pi.elapsed_travel +
+ pi.elapsed_interlevel + pi.elapsed_resting +
+ pi.elapsed_other);
+
+ PlaceInfo& pi2 = you.global_info;
+ pi2.elapsed_total = (pi2.elapsed_explore + pi2.elapsed_travel +
+ pi2.elapsed_interlevel + pi2.elapsed_resting +
+ pi2.elapsed_other);
+
return (you.num_turns - start);
}