summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilemcache.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-08-12 10:42:55 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-08-12 10:42:55 +0200
commit06e48cddf12c7f5bab187be7f3cfee06acc414d4 (patch)
treeb57b97a4e494feed44349b5cdd4bf2b4bfde1733 /crawl-ref/source/tilemcache.h
parent319ca4e023f349442d3869baca2745c6e0db44fc (diff)
downloadcrawl-ref-06e48cddf12c7f5bab187be7f3cfee06acc414d4.tar.gz
crawl-ref-06e48cddf12c7f5bab187be7f3cfee06acc414d4.zip
Repair saves with bad saved mcache values.
It can result in wrong tiles or lost weapon/enchantment markers, but at least there won't be a crash. (Please revert in trunk in a while, we want this assertion to stay.)
Diffstat (limited to 'crawl-ref/source/tilemcache.h')
-rw-r--r--crawl-ref/source/tilemcache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/tilemcache.h b/crawl-ref/source/tilemcache.h
index 1d856e9a01..f5a3fdec93 100644
--- a/crawl-ref/source/tilemcache.h
+++ b/crawl-ref/source/tilemcache.h
@@ -40,7 +40,7 @@ public:
virtual ~mcache_entry() {}
void inc_ref() { m_ref_count++; }
- void dec_ref() { m_ref_count--; ASSERT(m_ref_count >= 0); }
+ void dec_ref() { m_ref_count--; if (m_ref_count < 0) m_ref_count = 0; }
int ref_count() { return m_ref_count; }
enum