mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Fix: EPC inventory cannot be accessed, and Nails does not allow to take his vest
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6048 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6294,7 +6294,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Flugente: if we are on the same team, allow guaranteed full access
|
// Flugente: if we are on the same team, allow guaranteed full access
|
||||||
if ( gGameExternalOptions.fAccessOtherMercInventories && pOpponent->bTeam == pSoldier->bTeam && pOpponent->ubID != pSoldier->ubID )
|
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pOpponent->ubID) )
|
||||||
{
|
{
|
||||||
fStealItem = TRUE;
|
fStealItem = TRUE;
|
||||||
|
|
||||||
@@ -6305,6 +6305,10 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
|||||||
// - 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 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.
|
// or simplicity reasons, I will do #2 here. Until it breaks, then I'll be forced to do #1.
|
||||||
pSoldier->bSoldierFlagMask |= SOLDIER_ACCESSTEAMMEMBER;
|
pSoldier->bSoldierFlagMask |= SOLDIER_ACCESSTEAMMEMBER;
|
||||||
|
|
||||||
|
// if we are Nails, don't allow taking our vest
|
||||||
|
if ( pOpponent->ubProfile == 34 && i == VESTPOS )
|
||||||
|
fStealItem = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8553,7 +8553,7 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
|
|||||||
else if ( pTarget->bTeam == gbPlayerNum && !(gTacticalStatus.uiFlags & INCOMBAT) )
|
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
|
// 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 )
|
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTarget->ubID) && pSoldier->bSoldierFlagMask & SOLDIER_ACCESSTEAMMEMBER )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10147,3 +10147,11 @@ void TeamDropAll(UINT8 bTeam, BOOLEAN fForce)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// are we allowed to steal access this guy's inventory?
|
||||||
|
BOOLEAN AllowedToStealFromTeamMate( UINT8 ubID, UINT8 ubTargetID )
|
||||||
|
{
|
||||||
|
if ( gGameExternalOptions.fAccessOtherMercInventories && ubID != ubTargetID && MercPtrs[ubID]->bTeam == MercPtrs[ubTargetID]->bTeam && !AM_AN_EPC(MercPtrs[ubTargetID]) && !IsVehicle(MercPtrs[ubTargetID]) )
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|||||||
@@ -358,5 +358,8 @@ void HandleSurrenderOffer( SOLDIERTYPE* pSoldier ); // Flugente: offer t
|
|||||||
// setting fForce to TRUE allows dropping of gear in combat (used in auto-resolve instances)
|
// setting fForce to TRUE allows dropping of gear in combat (used in auto-resolve instances)
|
||||||
void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE);
|
void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE);
|
||||||
|
|
||||||
|
// are we allowed to steal access this guy's inventory?
|
||||||
|
BOOLEAN AllowedToStealFromTeamMate( UINT8 aAccessorID, UINT8 aTargetID );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -5676,7 +5676,7 @@ void HandleHandCursorClick( INT32 usMapPos, UINT32 *puiNewEvent )
|
|||||||
if ( gfUIFullTargetFound )
|
if ( gfUIFullTargetFound )
|
||||||
{
|
{
|
||||||
// Flugente: allow stealing if the other guy is an enemy, OR if we are on the same team
|
// Flugente: allow stealing if the other guy is an enemy, OR if we are on the same team
|
||||||
if ( (( guiUIFullTargetFlags & ENEMY_MERC ) && !( guiUIFullTargetFlags & UNCONSCIOUS_MERC )) || (gGameExternalOptions.fAccessOtherMercInventories && gusUIFullTargetID != pSoldier->ubID && guiUIFullTargetFlags & OWNED_MERC) )
|
if ( (( guiUIFullTargetFlags & ENEMY_MERC ) && !( guiUIFullTargetFlags & UNCONSCIOUS_MERC )) || (AllowedToStealFromTeamMate(pSoldier->ubID, (UINT8)gusUIFullTargetID) && guiUIFullTargetFlags & OWNED_MERC) )
|
||||||
{
|
{
|
||||||
sActionGridNo = FindAdjacentGridEx( pSoldier, MercPtrs[ gusUIFullTargetID ]->sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
sActionGridNo = FindAdjacentGridEx( pSoldier, MercPtrs[ gusUIFullTargetID ]->sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||||
if ( sActionGridNo == -1 )
|
if ( sActionGridNo == -1 )
|
||||||
|
|||||||
@@ -3089,7 +3089,7 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
{
|
{
|
||||||
// Calculate the possible chance to steal!
|
// Calculate the possible chance to steal!
|
||||||
// Flugente: if we are on the same team, allow guaranteed full access
|
// Flugente: if we are on the same team, allow guaranteed full access
|
||||||
if ( gGameExternalOptions.fAccessOtherMercInventories && pTargetSoldier->bTeam == pSoldier->bTeam && pTargetSoldier->ubID != pSoldier->ubID )
|
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) )
|
||||||
{
|
{
|
||||||
iHitChance = 100;
|
iHitChance = 100;
|
||||||
}
|
}
|
||||||
@@ -3188,7 +3188,7 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
// Do we have the chance to steal more than 1 item?
|
// Do we have the chance to steal more than 1 item?
|
||||||
// SANDRO - taking items from collapsed soldiers is treated differently
|
// SANDRO - taking items from collapsed soldiers is treated differently
|
||||||
// Flugente: if we are on the same team, allow guaranteed full access
|
// Flugente: if we are on the same team, allow guaranteed full access
|
||||||
if ( (gGameExternalOptions.fAccessOtherMercInventories && pTargetSoldier->bTeam == pSoldier->bTeam && pTargetSoldier->ubID != pSoldier->ubID ) || ( fSoldierCollapsed || (!gGameExternalOptions.fEnhancedCloseCombatSystem && iDiceRoll < (iHitChance * 2 / 3))) && pSoldier->bTeam == gbPlayerNum )
|
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) || ( fSoldierCollapsed || (!gGameExternalOptions.fEnhancedCloseCombatSystem && iDiceRoll < (iHitChance * 2 / 3))) && pSoldier->bTeam == gbPlayerNum )
|
||||||
{
|
{
|
||||||
// first, charge extra Aps, because it's difficlut to pickup from other soldier
|
// first, charge extra Aps, because it's difficlut to pickup from other soldier
|
||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
|
|||||||
Reference in New Issue
Block a user