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