Mercurial > repos > IBDev-IBBoard.WarFoundry.API
diff api/Factories/Xml/WarFoundryXmlFactory.cs @ 238:d1068f4b6d1c
Fixes #141: Check IDs of units on loading army
* IDs were already checked - now exceptions instead of ignoring (exception is already caught for other reasons)
Also:
* Code cleanup of main XML file factory
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 21 Feb 2010 20:25:52 +0000 |
parents | 06b4beb3e156 |
children | b9b8b0e60c31 |
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlFactory.cs Sun Feb 21 20:13:44 2010 +0000 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs Sun Feb 21 20:25:52 2010 +0000 @@ -135,14 +135,14 @@ { LogNotifier.DebugFormat(GetType(), "Complete loading of {0} with ID {1}", obj.GetType().Name, obj.ID); - if (obj is GameSystem) - { - CompleteLoadingGameSystem((GameSystem) obj); - } - else if (obj is Race) - { - CompleteLoadingRace((Race) obj); - } + if (obj is GameSystem) + { + CompleteLoadingGameSystem((GameSystem) obj); + } + else if (obj is Race) + { + CompleteLoadingRace((Race) obj); + } } private void CompleteLoadingRace(Race race) @@ -162,14 +162,13 @@ { try { - gameSystemFactory.CompleteLoading(system); - - } - catch (InvalidFileException ex) - { - WarFoundryLoader.GetDefault().RemoveGameSystem(system); - throw; - } + gameSystemFactory.CompleteLoading(system); + } + catch (InvalidFileException ex) + { + WarFoundryLoader.GetDefault().RemoveGameSystem(system); + throw; + } } } } \ No newline at end of file