mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- New Feature: dynamic opinions allows mercs to form opinions about each other depening on actions they/the player take or do not take. These can be viewed in the 'MeLoDY 'website. See also http://www.bears-pit.com/board/ubbthreads.php/topics/333259.html#Post333259
- Requires GameDir r2050. - new background property: <dislikebackground> allows mercs to dislike specific backgrounds - Fix: snitches did not correctly prevent misbehaviour - Fix: morale event was not handled - Fix: DropDowns did not refresh when using the arrow buttons git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7240 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -616,6 +616,9 @@ void HourlyFoodAutoDigestion( SOLDIERTYPE *pSoldier )
|
||||
|
||||
EatFromInventory( pSoldier, FALSE );
|
||||
}
|
||||
|
||||
// dynamic opinions: if we're still really hungry an someone in this sector has food, we get a lwoer opinion of him, as he obviously doesn't share
|
||||
HandleDynamicOpinionFoodSharing( pSoldier );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1061,3 +1064,38 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN fCheckDrink )
|
||||
{
|
||||
if ( !pSoldier )
|
||||
return FALSE;
|
||||
|
||||
if ( !fCheckFood && !fCheckDrink )
|
||||
return TRUE;
|
||||
|
||||
// search for food in our inventory
|
||||
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
|
||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
|
||||
{
|
||||
// ... if Item exists and is food ...
|
||||
if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].foodtype > 0 )
|
||||
{
|
||||
if ( fCheckFood && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bFoodPoints )
|
||||
return TRUE;
|
||||
|
||||
if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints )
|
||||
{
|
||||
if ( Item[pSoldier->inv[bLoop].usItem].canteen )
|
||||
{
|
||||
// empty canteens retain 1% status, so check ether something is in them
|
||||
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user