From 74fb71b2538705de1405919cbc2bb775d2e301fe Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 16 Jul 2007 00:59:11 +0000 Subject: [PATCH] fixed map loading for maps with no TERRAIN section (trees) git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1282 993157c7-ee19-0410-b2c4-bb4e9862e678 --- OpenRa.FileFormats/Map.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRa.FileFormats/Map.cs b/OpenRa.FileFormats/Map.cs index 6c957274dc..4776132f25 100644 --- a/OpenRa.FileFormats/Map.cs +++ b/OpenRa.FileFormats/Map.cs @@ -120,6 +120,9 @@ namespace OpenRa.FileFormats void ReadTrees( IniFile file ) { IniSection terrain = file.GetSection( "TERRAIN" ); + if( terrain == null ) + return; + foreach( KeyValuePair kv in terrain ) Trees.Add( new TreeReference( int.Parse( kv.Key ), kv.Value ) ); }