summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/place-info.cc
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-08-19 17:08:51 +0200
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-08-19 17:08:51 +0200
commit8908dede2320002e63e95e3b98eddbd441db8fb4 (patch)
treeedf60cd1f4d015713c3263459f96f84ab014f847 /crawl-ref/source/place-info.cc
parent753504945b5acaaac49f05636eb06b1adceeb2c3 (diff)
downloadcrawl-ref-8908dede2320002e63e95e3b98eddbd441db8fb4.tar.gz
crawl-ref-8908dede2320002e63e95e3b98eddbd441db8fb4.zip
Reinit global_info (PlaceInfo) when starting a new game. Fixes crashes.
With thanks to Syllogism's throw-away comment on Something Awful. I hadn't realized it was _that_ easy. :)
Diffstat (limited to 'crawl-ref/source/place-info.cc')
-rw-r--r--crawl-ref/source/place-info.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/place-info.cc b/crawl-ref/source/place-info.cc
index 7523f41fcc..d0783d8083 100644
--- a/crawl-ref/source/place-info.cc
+++ b/crawl-ref/source/place-info.cc
@@ -183,3 +183,12 @@ PlaceInfo& player::get_place_info(branch_type branch,
else
return (PlaceInfo&) non_branch_info[level_type2 - 1];
}
+
+void player::clear_place_info()
+{
+ you.global_info = PlaceInfo();
+ for (unsigned int i = 0; i < NUM_BRANCHES; ++i)
+ branch_info[i] = PlaceInfo();
+ for (unsigned int i = 0; i < NUM_LEVEL_AREA_TYPES - 1; ++i)
+ non_branch_info[i] = PlaceInfo();
+}