Items in a slot granted by LBE with the flag LBE_EXPLOSIONPROOF (<ItemFlag> 2147483648) are protected from explosion damage (and cannot cause a chain reaction).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8335 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-10-24 20:15:35 +00:00
parent fcfab521fb
commit 3c836ba191
2 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -769,7 +769,7 @@ extern OBJECTTYPE gTempObject;
#define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player
#define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory
#define DISEASEPROTECTION_2 0x40000000 //1073741824 // this item protects us from getting diseases by human contact if kept in inventory
/*#define PLAYER_NET_4_LVL_4 0x80000000 //2147483648*/
#define LBE_EXPLOSIONPROOF 0x80000000 //2147483648 // any gear in LBE with this flag is protected from explosions
// ----------------------------------------------------------------
// -------- added by Flugente: flags for objects --------
+31 -1
View File
@@ -92,6 +92,8 @@ extern BOOLEAN fMapInventoryZoom;
// HEADROCK HAM 5: And this, for checking whether an item is in the pool.
extern std::vector<WORLDITEM> pInventoryPoolList;
extern INT16 uiNIVSlotType[NUM_INV_SLOTS];
UINT16 OldWayOfCalculatingScopeBonus(SOLDIERTYPE *pSoldier);
// weight units are 100g each
@@ -8966,9 +8968,37 @@ void CheckEquipmentForDamage( SOLDIERTYPE *pSoldier, INT32 iDamage )
UINT8 invsize = pSoldier->inv.size();
for (UINT8 bSlot = 0; bSlot < invsize; ++bSlot)
{
if (pSoldier->inv[bSlot].exists() == false) {
if (pSoldier->inv[bSlot].exists() == false){
continue;
}
// Flugente: if this item is 'in' LBE that protects it, don't damage it
if ( UsingNewInventorySystem( ) )
{
INT16 lbeslot = 0;
switch ( uiNIVSlotType[bSlot] )
{
case 3: lbeslot = VESTPOCKPOS; break;
case 4:
if ( bSlot == MEDPOCK3POS || bSlot == SMALLPOCK11POS || bSlot == SMALLPOCK12POS || bSlot == SMALLPOCK13POS || bSlot == SMALLPOCK14POS )
lbeslot = LTHIGHPOCKPOS;
else
lbeslot = RTHIGHPOCKPOS;
break;
case 5: lbeslot = CPACKPOCKPOS; break;
case 6: lbeslot = BPACKPOCKPOS; break;
default:
break;
}
if ( VESTPOCKPOS <= lbeslot && lbeslot <= BPACKPOCKPOS )
{
if ( pSoldier->inv[lbeslot].exists( ) && HasItemFlag( pSoldier->inv[lbeslot].usItem, LBE_EXPLOSIONPROOF ) )
continue;
}
}
ubNumberOfObjects = pSoldier->inv[bSlot].ubNumberOfObjects;
fBlowsUp = DamageItem( &(pSoldier->inv[bSlot]), iDamage, FALSE );
if (fBlowsUp)