From ede7d2a54517817157837d071bc51155614b1527 Mon Sep 17 00:00:00 2001 From: avolkov Date: Wed, 27 Apr 2011 08:44:39 +0000 Subject: [PATCH] Prevent unnecessary 'Trying to get null resource' console warnings while loading ship data; bug #1123 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3595 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/loadship.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/sc2/src/uqm/loadship.c b/sc2/src/uqm/loadship.c index ba4d9c671..3e73c1f41 100644 --- a/sc2/src/uqm/loadship.c +++ b/sc2/src/uqm/loadship.c @@ -71,25 +71,34 @@ load_ship (SPECIES_ID SpeciesID, BOOLEAN LoadBattleData) goto BadLoad; RDPtr->CodeRef = CodeRef; - RDPtr->ship_info.icons = CaptureDrawable (LoadGraphic ( - RDPtr->ship_info.icons_rsc)); - if (!RDPtr->ship_info.icons) + if (RDPtr->ship_info.icons_rsc != NULL_RESOURCE) { - /* goto BadLoad */ + RDPtr->ship_info.icons = CaptureDrawable (LoadGraphic ( + RDPtr->ship_info.icons_rsc)); + if (!RDPtr->ship_info.icons) + { + /* goto BadLoad */ + } } - - RDPtr->ship_info.melee_icon = CaptureDrawable (LoadGraphic ( - RDPtr->ship_info.melee_icon_rsc)); - if (!RDPtr->ship_info.melee_icon) + + if (RDPtr->ship_info.melee_icon_rsc != NULL_RESOURCE) { - /* goto BadLoad */ + RDPtr->ship_info.melee_icon = CaptureDrawable (LoadGraphic ( + RDPtr->ship_info.melee_icon_rsc)); + if (!RDPtr->ship_info.melee_icon) + { + /* goto BadLoad */ + } } - RDPtr->ship_info.race_strings = CaptureStringTable (LoadStringTable ( - RDPtr->ship_info.race_strings_rsc)); - if (!RDPtr->ship_info.race_strings) + if (RDPtr->ship_info.race_strings_rsc != NULL_RESOURCE) { - /* goto BadLoad */ + RDPtr->ship_info.race_strings = CaptureStringTable (LoadStringTable ( + RDPtr->ship_info.race_strings_rsc)); + if (!RDPtr->ship_info.race_strings) + { + /* goto BadLoad */ + } } if (LoadBattleData)