Fix: when accessing a teammember's inventory, circumstances could cause teammembers to attack the merc accessing

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6046 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-05-01 14:58:51 +00:00
parent cde29c1388
commit e508e91cff
4 changed files with 21 additions and 3 deletions
+10
View File
@@ -6295,7 +6295,17 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
{
// Flugente: if we are on the same team, allow guaranteed full access
if ( gGameExternalOptions.fAccessOtherMercInventories && pOpponent->bTeam == pSoldier->bTeam && pOpponent->ubID != pSoldier->ubID )
{
fStealItem = TRUE;
// yuk, this is ugly... stealing items is counted as an attack. So what happens that if we steal from a teammember, the merc that we have stored in our targetD
// (which will be the first merc hired when we land in Arulco) will react to our 'attack' and 'shoot back'.
// so we now have 2 ways to resolve this issue:
// - remove the 'steal from teammember' stuff from the usual stealing stuff, and add it as a new action (like handcuffing), complete with building the steal-sub-menu and everything
// - or introduce a flag that prohibits teammembers from 'reaction-firing' on us. Set it upon stealing (here) and remove it after the steal menu is closed
// or simplicity reasons, I will do #2 here. Until it breaks, then I'll be forced to do #1.
pSoldier->bSoldierFlagMask |= SOLDIER_ACCESSTEAMMEMBER;
}
else
{
// Check, if we can steal the item
+3
View File
@@ -10813,6 +10813,9 @@ void RemoveItemPickupMenu( )
// Unfreese guy!
gItemPickupMenu.pSoldier->flags.fPauseAllAnimation = FALSE;
// Flugente: remove the marker notifying we are currently stealing
gItemPickupMenu.pSoldier->bSoldierFlagMask &= ~SOLDIER_ACCESSTEAMMEMBER;
// Remove graphics!
DeleteVideoObjectFromIndex( gItemPickupMenu.uiPanelVo );
+6 -1
View File
@@ -8552,8 +8552,13 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
}
else if ( pTarget->bTeam == gbPlayerNum && !(gTacticalStatus.uiFlags & INCOMBAT) )
{
// Flugente: if we are on the same team adn are currently stealing (accessing inventory) from a teammember, do NOT retaliate
if ( gGameExternalOptions.fAccessOtherMercInventories && pTarget->bTeam == pSoldier->bTeam && pTarget->ubID != pSoldier->ubID && pSoldier->bSoldierFlagMask & SOLDIER_ACCESSTEAMMEMBER )
{
}
// firing at one of our own guys who is not a rebel etc
if ( pTarget->stats.bLife >= OKLIFE && !(pTarget->bCollapsed) && !AM_A_ROBOT( pTarget ) && (bReason == REASON_NORMAL_ATTACK ) )
else if ( pTarget->stats.bLife >= OKLIFE && !(pTarget->bCollapsed) && !AM_A_ROBOT( pTarget ) && (bReason == REASON_NORMAL_ATTACK ) )
{
// OK, sturn towards the prick
// Change to fire ready animation
+2 -2
View File
@@ -366,8 +366,8 @@ enum
#define SOLDIER_POW_PRISON 0x00001000 //4096 // this guy is a prisoner of war in a prison sector. SOLDIER_POW refers to people we capture, this refers to people we hold captive
#define SOLDIER_EQUIPMENT_DROPPED 0x00002000 //8192 // under certain circumstances, militia can be ordered to drop their gear twice. Thus we set a marker to avoid that.
/*#define ENEMY_NET_3_LVL_4 0x00004000 //16384
#define ENEMY_NET_4_LVL_4 0x00008000 //32768
#define SOLDIER_ACCESSTEAMMEMBER 0x00004000 //16384 // this merc is accessing another team member'S inventory (via abusing the stealing mechanic)
/*#define ENEMY_NET_4_LVL_4 0x00008000 //32768
#define PLAYER_NET_1_LVL_1 0x00010000 //65536
#define PLAYER_NET_2_LVL_1 0x00020000 //131072