mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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
This commit is contained in:
+7
-2
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user