From 9f43d61c2c4f1a9ae760158d3e57601e39ff4a24 Mon Sep 17 00:00:00 2001 From: Quietust Date: Mon, 13 Feb 2012 09:56:35 -0600 Subject: [PATCH] Fix MapCache crash when in Arena mode --- library/include/modules/MapCache.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/include/modules/MapCache.h b/library/include/modules/MapCache.h index 953a7ed00..5c227fa70 100644 --- a/library/include/modules/MapCache.h +++ b/library/include/modules/MapCache.h @@ -76,6 +76,11 @@ void SquashRocks ( std::vector< std::vector > * layerassign, DFHack:: materials[xx][yy] = -1; continue; } + if (mb.biome_indices[test] >= layerassign->size()) + { + materials[xx][yy] = -1; + continue; + } materials[xx][yy] = layerassign->at(mb.biome_indices[test])[mb.designation[xx][yy].bits.geolayer_index]; }