From 7a81a212a9b97efe399e11c5abb2334c95f9c7d0 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 1 Oct 2012 20:55:19 +0000 Subject: [PATCH] random items do not spawn food if food system is deactivated git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5599 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Items.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index dd3d73c94..52ab512df 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -14781,7 +14781,6 @@ BOOLEAN GetItemFromRandomItem( UINT16 usRandomItem, UINT16* pusNewItem ) rdclasstaboocnt = 0; // determine maximum allowed coolness - // TODO: adjust this depending on a random item coolness modificator rditemmaxcoolness = HighestPlayerProgressPercentage() / 10 + 1 + Item[usRandomItem].randomitemcoolnessmodificator; // the random item itself can modify coolness // build the list of items to choose from. We will search down the random item class an can even branch into mulitple other random item classes. @@ -14860,7 +14859,13 @@ BOOL AddToRandomListFromItem( UINT16 usItem ) { // only allow those items that are viable at the current progress if ( Item[usItem].ubCoolness <= rditemmaxcoolness ) - randomitemarray[itemcnt++] = usItem; + { + // if item is food, not drug or canteen, and food system is off, don't add this + if ( !gGameOptions.fFoodSystem && Item[usItem].foodtype > 0 && Item[usItem].drugtype == 0 && Item[usItem].canteen == 0 ) + ; + else + randomitemarray[itemcnt++] = usItem; + } // if maximum is reached, return false, thereby signalling an end return ( itemcnt < RANDOM_ITEM_MAX_NUMBER );