mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- Fix: mercs can consume items that shouldnt' be consumed
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7900 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "Tactical Save.h" // added by Flugente
|
||||
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinions()
|
||||
#include "Drugs And Alcohol.h" // added by Flugente for HourlyDrugUpdate()
|
||||
#include "Interface.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
#include "Luaglobal.h"
|
||||
@@ -514,7 +515,7 @@ void HourlyLarryUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "Interface.h"
|
||||
|
||||
// Flugente: mercs that are smokers occasionally consume smokes if they have some in their inventory
|
||||
void HourlySmokerUpdate( )
|
||||
{
|
||||
|
||||
@@ -22902,6 +22902,7 @@ BOOLEAN ApplyConsumable( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce
|
||||
if ( !(Item[pObj->usItem].usItemClass & (IC_KIT | IC_MISC)) )
|
||||
return FALSE;
|
||||
|
||||
BOOLEAN fSuccess = FALSE;
|
||||
BOOLEAN fDoSound = FALSE;
|
||||
|
||||
// use portionsize, if none was entered, use full item
|
||||
@@ -22993,6 +22994,7 @@ BOOLEAN ApplyConsumable( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce
|
||||
// this returns true if camo can be applied, but APs were only used, and the action happened, if *pfGoodAPs is TRUE
|
||||
if ( ApplyCamo( pSoldier, pObj->usItem, statusused ) )
|
||||
{
|
||||
fSuccess = TRUE;
|
||||
fDoSound = TRUE;
|
||||
|
||||
// WANNE: We should only delete the face, if there was a camo we applied.
|
||||
@@ -23008,47 +23010,57 @@ BOOLEAN ApplyConsumable( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce
|
||||
|
||||
if ( ApplyCanteen( pSoldier, pObj->usItem, statusused ) )
|
||||
{
|
||||
fSuccess = TRUE;
|
||||
fDoSound = FALSE;
|
||||
}
|
||||
|
||||
if ( ApplyElixir( pSoldier, pObj->usItem, statusused ) )
|
||||
{
|
||||
fSuccess = TRUE;
|
||||
fDoSound = TRUE;
|
||||
}
|
||||
|
||||
if ( ApplyClothes( pSoldier, pObj->usItem, statusused ) )
|
||||
{
|
||||
|
||||
fSuccess = TRUE;
|
||||
}
|
||||
|
||||
if ( ApplyFood( pSoldier, pObj, statusused ) )
|
||||
{
|
||||
fSuccess = TRUE;
|
||||
fDoSound = FALSE;
|
||||
}
|
||||
|
||||
if ( ApplyDrugs_New( pSoldier, pObj->usItem, statusused ) )
|
||||
{
|
||||
fSuccess = TRUE;
|
||||
|
||||
// no sound on consuming cigarettes, as that is very annoying
|
||||
if ( !Item[pObj->usItem].cigarette )
|
||||
{
|
||||
fDoSound = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// use up object
|
||||
UseKitPoints( pObj, statusused, pSoldier );
|
||||
|
||||
if ( fUseAPs )
|
||||
if ( fSuccess )
|
||||
{
|
||||
// Dirty
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
// use up object
|
||||
UseKitPoints( pObj, statusused, pSoldier );
|
||||
|
||||
if ( fUseAPs )
|
||||
{
|
||||
// Dirty
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
|
||||
if ( fDoSound )
|
||||
{
|
||||
// Say OK acknowledge....
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( fDoSound )
|
||||
{
|
||||
// Say OK acknowledge....
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user