From 07aee0e43faec8c8ff94186b7be88348ec6a8177 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Mon, 5 Jun 2006 07:06:19 +0000 Subject: [PATCH] -added code for enemies to carry money items / wallets w/actual deposit-able cash git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@173 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Inventory Choosing.cpp | 6 +++++- Tactical/Items.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Tactical/Inventory Choosing.cpp b/Tactical/Inventory Choosing.cpp index f5c83a73..0348f313 100644 --- a/Tactical/Inventory Choosing.cpp +++ b/Tactical/Inventory Choosing.cpp @@ -1786,7 +1786,11 @@ void ChooseMiscGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bMiscC usItem = PickARandomItem (MISCITEMS , bMiscClass, FALSE); if ( usItem > 0 ) { - CreateItem( usItem, (INT8)(80 + Random( 21 )), &Object ); + int bStatus = 80 + Random( 21 ); + if ( Item[usItem].usItemClass == IC_MONEY ) + bStatus = 1 + Random( 20 ); + + CreateItem( usItem, (INT8)(bStatus), &Object ); Object.fFlags |= OBJECT_UNDROPPABLE; PlaceObjectInSoldierCreateStruct( pp, &Object ); } diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index aad1876b..784e931d 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -4699,7 +4699,7 @@ BOOLEAN CreateItem( UINT16 usItem, INT8 bStatus, OBJECTTYPE * pObj ) { pObj->usItem = usItem; pObj->ubNumberOfObjects = 1; - if (usItem == MONEY) + if (usItem == MONEY || Item[usItem].usItemClass == IC_MONEY ) { // special case... always set status to 100 when creating // and use status value to determine amount!