Feature improvement: allow accessing other merc inventories when ACCESS_OTHER_MERC_INVENTORIES is TRUE. Even works with dying mercs.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6033 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-04-28 22:59:09 +00:00
parent 7f467f4f80
commit 3b0d8613af
5 changed files with 79 additions and 61 deletions
+64 -58
View File
@@ -6293,69 +6293,75 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
}
else
{
// Check, if we can steal the item
// CHRISL: Added new case definitions for new inventory pockets
switch (i)
// Flugente: if we are on the same team, allow guaranteed full access
if ( gGameExternalOptions.fAccessOtherMercInventories && pOpponent->bTeam == pSoldier->bTeam )
fStealItem = TRUE;
else
{
case HANDPOS:
case GUNSLINGPOCKPOS:
// Check, if we can steal the item
// CHRISL: Added new case definitions for new inventory pockets
switch (i)
{
// Flugente: if item has a weapon sling attached, it can't be stolen
if ( HasAttachmentOfClass(pObject, AC_SLING) )
fStealItem = FALSE;
else
fStealItem = TRUE;
case HANDPOS:
case GUNSLINGPOCKPOS:
{
// Flugente: if item has a weapon sling attached, it can't be stolen
if ( HasAttachmentOfClass(pObject, AC_SLING) )
fStealItem = FALSE;
else
fStealItem = TRUE;
break;
}
case SECONDHANDPOS:
case KNIFEPOCKPOS:
case BIGPOCK1POS:
case BIGPOCK2POS:
case BIGPOCK3POS:
case BIGPOCK4POS:
case BIGPOCK5POS:
case BIGPOCK6POS:
case BIGPOCK7POS:
case MEDPOCK1POS:
case MEDPOCK2POS:
case MEDPOCK3POS:
case MEDPOCK4POS:
case SMALLPOCK1POS:
case SMALLPOCK2POS:
case SMALLPOCK3POS:
case SMALLPOCK4POS:
case SMALLPOCK5POS:
case SMALLPOCK6POS:
case SMALLPOCK7POS:
case SMALLPOCK8POS:
case SMALLPOCK9POS:
case SMALLPOCK10POS:
case SMALLPOCK11POS:
case SMALLPOCK12POS:
case SMALLPOCK13POS:
case SMALLPOCK14POS:
case SMALLPOCK15POS:
case SMALLPOCK16POS:
case SMALLPOCK17POS:
case SMALLPOCK18POS:
case SMALLPOCK19POS:
case SMALLPOCK20POS:
case SMALLPOCK21POS:
case SMALLPOCK22POS:
case SMALLPOCK23POS:
case SMALLPOCK24POS:
case SMALLPOCK25POS:
case SMALLPOCK26POS:
case SMALLPOCK27POS:
case SMALLPOCK28POS:
case SMALLPOCK29POS:
case SMALLPOCK30POS:
fStealItem = TRUE;
break;
default:
fStealItem = FALSE;
break;
}
case SECONDHANDPOS:
case KNIFEPOCKPOS:
case BIGPOCK1POS:
case BIGPOCK2POS:
case BIGPOCK3POS:
case BIGPOCK4POS:
case BIGPOCK5POS:
case BIGPOCK6POS:
case BIGPOCK7POS:
case MEDPOCK1POS:
case MEDPOCK2POS:
case MEDPOCK3POS:
case MEDPOCK4POS:
case SMALLPOCK1POS:
case SMALLPOCK2POS:
case SMALLPOCK3POS:
case SMALLPOCK4POS:
case SMALLPOCK5POS:
case SMALLPOCK6POS:
case SMALLPOCK7POS:
case SMALLPOCK8POS:
case SMALLPOCK9POS:
case SMALLPOCK10POS:
case SMALLPOCK11POS:
case SMALLPOCK12POS:
case SMALLPOCK13POS:
case SMALLPOCK14POS:
case SMALLPOCK15POS:
case SMALLPOCK16POS:
case SMALLPOCK17POS:
case SMALLPOCK18POS:
case SMALLPOCK19POS:
case SMALLPOCK20POS:
case SMALLPOCK21POS:
case SMALLPOCK22POS:
case SMALLPOCK23POS:
case SMALLPOCK24POS:
case SMALLPOCK25POS:
case SMALLPOCK26POS:
case SMALLPOCK27POS:
case SMALLPOCK28POS:
case SMALLPOCK29POS:
case SMALLPOCK30POS:
fStealItem = TRUE;
break;
default:
fStealItem = FALSE;
break;
}
}