mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix for AI seeking climb point in toxic gas
Fix for civilians trying to climb the roof to seek noise Fix for punching and stabbing Transparent change: Gave names to anonymous structs in OBJECTTYPE git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1225 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4543,17 +4543,17 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle )
|
||||
{ //Message for vehicle full?
|
||||
return;
|
||||
}
|
||||
if( pItem->bStatus )
|
||||
if( pItem->ItemData.Generic.bStatus )
|
||||
{ //Fill 'er up.
|
||||
sFuelNeeded = 10000 - pVehicle->sBreathRed;
|
||||
sFuelAvailable = pItem->bStatus[0] * 50;
|
||||
sFuelAvailable = pItem->ItemData.Generic.bStatus[0] * 50;
|
||||
sFuelAdded = min( sFuelNeeded, sFuelAvailable );
|
||||
//Add to vehicle
|
||||
pVehicle->sBreathRed += sFuelAdded;
|
||||
pVehicle->bBreath = (INT8)(pVehicle->sBreathRed / 100);
|
||||
//Subtract from item
|
||||
pItem->bStatus[0] = (INT8)(pItem->bStatus[0] - sFuelAdded / 50);
|
||||
if( !pItem->bStatus[0] )
|
||||
pItem->ItemData.Generic.bStatus[0] = (INT8)(pItem->ItemData.Generic.bStatus[0] - sFuelAdded / 50);
|
||||
if( !pItem->ItemData.Generic.bStatus[0] )
|
||||
{ //Gas can is empty, so toast the item.
|
||||
DeleteObj( pItem );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user