mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +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 "Tactical Save.h" // added by Flugente
|
||||||
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinions()
|
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinions()
|
||||||
#include "Drugs And Alcohol.h" // added by Flugente for HourlyDrugUpdate()
|
#include "Drugs And Alcohol.h" // added by Flugente for HourlyDrugUpdate()
|
||||||
|
#include "Interface.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Luaglobal.h"
|
#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
|
// Flugente: mercs that are smokers occasionally consume smokes if they have some in their inventory
|
||||||
void HourlySmokerUpdate( )
|
void HourlySmokerUpdate( )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22902,6 +22902,7 @@ BOOLEAN ApplyConsumable( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, BOOLEAN fForce
|
|||||||
if ( !(Item[pObj->usItem].usItemClass & (IC_KIT | IC_MISC)) )
|
if ( !(Item[pObj->usItem].usItemClass & (IC_KIT | IC_MISC)) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
BOOLEAN fSuccess = FALSE;
|
||||||
BOOLEAN fDoSound = FALSE;
|
BOOLEAN fDoSound = FALSE;
|
||||||
|
|
||||||
// use portionsize, if none was entered, use full item
|
// 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
|
// 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 ) )
|
if ( ApplyCamo( pSoldier, pObj->usItem, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
fDoSound = TRUE;
|
fDoSound = TRUE;
|
||||||
|
|
||||||
// WANNE: We should only delete the face, if there was a camo we applied.
|
// 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 ) )
|
if ( ApplyCanteen( pSoldier, pObj->usItem, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
fDoSound = FALSE;
|
fDoSound = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ApplyElixir( pSoldier, pObj->usItem, statusused ) )
|
if ( ApplyElixir( pSoldier, pObj->usItem, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
fDoSound = TRUE;
|
fDoSound = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ApplyClothes( pSoldier, pObj->usItem, statusused ) )
|
if ( ApplyClothes( pSoldier, pObj->usItem, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ApplyFood( pSoldier, pObj, statusused ) )
|
if ( ApplyFood( pSoldier, pObj, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
fDoSound = FALSE;
|
fDoSound = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ApplyDrugs_New( pSoldier, pObj->usItem, statusused ) )
|
if ( ApplyDrugs_New( pSoldier, pObj->usItem, statusused ) )
|
||||||
{
|
{
|
||||||
|
fSuccess = TRUE;
|
||||||
|
|
||||||
// no sound on consuming cigarettes, as that is very annoying
|
// no sound on consuming cigarettes, as that is very annoying
|
||||||
if ( !Item[pObj->usItem].cigarette )
|
if ( !Item[pObj->usItem].cigarette )
|
||||||
{
|
{
|
||||||
fDoSound = TRUE;
|
fDoSound = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// use up object
|
|
||||||
UseKitPoints( pObj, statusused, pSoldier );
|
|
||||||
|
|
||||||
if ( fUseAPs )
|
if ( fSuccess )
|
||||||
{
|
{
|
||||||
// Dirty
|
// use up object
|
||||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
UseKitPoints( pObj, statusused, pSoldier );
|
||||||
|
|
||||||
|
if ( fUseAPs )
|
||||||
|
{
|
||||||
|
// Dirty
|
||||||
|
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( fDoSound )
|
||||||
|
{
|
||||||
|
// Say OK acknowledge....
|
||||||
|
pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( fDoSound )
|
return FALSE;
|
||||||
{
|
|
||||||
// Say OK acknowledge....
|
|
||||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user