From f3553cf888d59746f74ebb52189a9373b99e9618 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Wed, 4 Mar 2015 10:54:28 +0000 Subject: [PATCH] Fix: Mercs that have the tag in their background spawned a bottle of alcohol anywhere in there inventory at full hour when function HourlyLarryUpdate() was run. The bottle would spawn in invalid slots as well for example the backpack slot. Now the game will only spawn a 25% condition bottle which is consumed right away which solves the inventory problem. This is more or less a hackfix. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7766 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Hourly Update.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Strategic/Hourly Update.cpp b/Strategic/Hourly Update.cpp index afe39d9fb..02944d24e 100644 --- a/Strategic/Hourly Update.cpp +++ b/Strategic/Hourly Update.cpp @@ -481,7 +481,9 @@ void HourlyLarryUpdate() if ( fBar ) { // take $ from player's account - usCashAmount = Item[ ALCOHOL ].usPrice; + // silversurfer: changed the price to reflect the changed amount of 25% below + //usCashAmount = Item[ ALCOHOL ].usPrice; + usCashAmount = (UINT16)(Item[ ALCOHOL ].usPrice / 4.0f ); AddTransactionToPlayersBook ( TRANSFER_FUNDS_TO_MERC, pSoldier->ubProfile, GetWorldTotalMin() , -( usCashAmount ) ); // give Larry some booze and set slot etc values appropriately // CHRISL: Change final parameter to allow dynamic control of inventory slots @@ -489,7 +491,10 @@ void HourlyLarryUpdate() if ( bBoozeSlot != NO_SLOT ) { // give Larry booze here - CreateItem( ALCOHOL, 100, &(pSoldier->inv[bBoozeSlot]) ); + // silversurfer: only give the merc a 25% bottle. This fixes the problem that the bottle of alcohol can go to any inventory slot even one that isn't available. + // Now the bottle will be fully consumed below and vanishes from inventory before the player even gets to see it. This simulates going to a bar to have a drink there. + //CreateItem( ALCOHOL, 100, &(pSoldier->inv[bBoozeSlot]) ); + CreateItem( ALCOHOL, 25, &(pSoldier->inv[bBoozeSlot]) ); } bSlot = bBoozeSlot; bLarryItemLoop = 1;