Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Tactical/Handle UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7425,9 +7425,7 @@ BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fChec
}

// This ain't gonna happen with backpack
if((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pSoldier->CanClimbWithCurrentBackpack())
{
return( FALSE );
}
Expand Down
20 changes: 4 additions & 16 deletions Tactical/Interface Panels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4632,10 +4632,7 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)

if ( fNearLowerLevel )
{
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!gpSMCurrentMerc->CanClimbWithCurrentBackpack())
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
return;
Expand All @@ -4646,10 +4643,7 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)

if ( fNearHeigherLevel )
{
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!gpSMCurrentMerc->CanClimbWithCurrentBackpack())
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
return;
Expand All @@ -4662,10 +4656,7 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)

if (gGameExternalOptions.fCanClimbOnWalls == TRUE)
{
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!gpSMCurrentMerc->CanClimbWithCurrentBackpack())
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
return;
Expand All @@ -4681,10 +4672,7 @@ void BtnClimbCallback(GUI_BUTTON *btn,INT32 reason)

if ( FindFenceJumpDirection( gpSMCurrentMerc, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->ubDirection, &bDirection ) )
{
if ((UsingNewInventorySystem() == true) && gpSMCurrentMerc->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)gpSMCurrentMerc->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[gpSMCurrentMerc->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!gpSMCurrentMerc->CanClimbWithCurrentBackpack())
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
return;
Expand Down
4 changes: 1 addition & 3 deletions Tactical/PATHAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2580,9 +2580,7 @@ if(!GridNoOnVisibleWorldTile(iDestination))
fTurnBased = ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) );

fPathingForPlayer = ( (s->bTeam == gbPlayerNum) && (!gTacticalStatus.fAutoBandageMode) && !(s->flags.uiStatusFlags & SOLDIER_PCUNDERAICONTROL) );
fNonFenceJumper = !( IS_MERC_BODY_TYPE( s ) ) || (UsingNewInventorySystem() == true && s->inv[BPACKPOCKPOS].exists() == true
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)s->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[s->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[s->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)));//Moa: added backpack check
fNonFenceJumper = !( IS_MERC_BODY_TYPE( s ) ) || (!s->CanClimbWithCurrentBackpack());//Moa: added backpack check
Copy link
Copy Markdown
Contributor

@majcosta majcosta Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change to isFenceJumper = IS_MERC_BODY_TYPE( s ) && s->CanClimbWithCurrentBackpack();? naming a variable for a negation seems like twice the cognitive load.

edit: out of scope, obvs


// Flugente: nonswimmers are those who are not mercs and not boats
fNonSwimmer = !(IS_MERC_BODY_TYPE( s ) );
Expand Down
4 changes: 1 addition & 3 deletions Tactical/Points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, INT8

//CHRISL: We can't jump a fence while wearing a backpack, to consider fences as impassible
// SANDRO - Headrocks change to backpack check implemented
if(sSwitchValue == TRAVELCOST_FENCE && UsingNewInventorySystem() == true && pSoldier->inv[BPACKPOCKPOS].exists() == true
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if(sSwitchValue == TRAVELCOST_FENCE && !pSoldier->CanClimbWithCurrentBackpack())
{
return(-1);
}
Expand Down
14 changes: 4 additions & 10 deletions Tactical/Real Time Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,12 +2110,9 @@ void HandleMouseRTX1Button( UINT32 *puiNewEvent )
BOOLEAN fNearHeigherLevel;
BOOLEAN fNearLowerLevel;
INT8 bDirection;
// CHRISL: Turn off manual jumping while wearing a backpack
if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

// CHRISL: Turn off manual jumping while wearing a backpack
if (!pjSoldier->CanClimbWithCurrentBackpack())
return;

// Make sure the merc is not collapsed!
Expand Down Expand Up @@ -2207,12 +2204,9 @@ void HandleRTJump( void )
BOOLEAN fNearHeigherLevel;
BOOLEAN fNearLowerLevel;
INT8 bDirection;
// CHRISL: Turn off manual jumping while wearing a backpack
if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

// CHRISL: Turn off manual jumping while wearing a backpack
if (!pjSoldier->CanClimbWithCurrentBackpack())
return;

// Make sure the merc is not collapsed!
Expand Down
16 changes: 12 additions & 4 deletions Tactical/Soldier Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9430,10 +9430,7 @@ void MoveMercFacingDirection( SOLDIERTYPE *pSoldier, BOOLEAN fReverse, FLOAT dMo
void SOLDIERTYPE::BeginSoldierClimbUpRoof(void)
{
//CHRISL: Disable climbing up to a roof while wearing a backpack
if ((UsingNewInventorySystem() == true) && this->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)this->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[this->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[this->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!this->CanClimbWithCurrentBackpack())
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB]);
return;
Expand Down Expand Up @@ -9727,6 +9724,17 @@ UINT32 SleepDartSuccumbChance( SOLDIERTYPE * pSoldier )
return(uiChance);
}

BOOLEAN SOLDIERTYPE::CanClimbWithCurrentBackpack()
{
// only apply backpack climbing limitations to player mercs
if (UsingNewInventorySystem() == true && this->inv[BPACKPOCKPOS].exists() == true && this->bTeam == OUR_TEAM
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)this->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[this->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[this->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
return FALSE;

return TRUE;
}

void SOLDIERTYPE::BeginSoldierGetup( void )
{
// RETURN IF WE ARE BEING SERVICED
Expand Down
1 change: 1 addition & 0 deletions Tactical/Soldier Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,7 @@ class SOLDIERTYPE//last edited at version 102
void DoNinjaAttack( void );
void PickDropItemAnimation( void );

BOOLEAN CanClimbWithCurrentBackpack();

void BeginSoldierGetup( void );
void BeginSoldierClimbUpRoof( void );
Expand Down
55 changes: 10 additions & 45 deletions Tactical/Turn Based Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3863,10 +3863,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if ( fNearLowerLevel )
{
// No climbing when wearing a backpack!
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pjSoldier->CanClimbWithCurrentBackpack())
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] );
return;
Expand All @@ -3882,10 +3879,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if ( fNearHeigherLevel )
{
// No climbing when wearing a backpack!
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pjSoldier->CanClimbWithCurrentBackpack())
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] );
return;
Expand All @@ -3901,10 +3895,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
// Jump over fence
if ( FindFenceJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) )
{
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pjSoldier->CanClimbWithCurrentBackpack())
{
//Moa: no jumping whith backpack
//sAPCost = GetAPsToJumpFence( pjSoldier, TRUE );
Expand All @@ -3929,10 +3920,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if (gGameExternalOptions.fCanClimbOnWalls == TRUE)
{
// No climbing when wearing a backpack!
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pjSoldier->CanClimbWithCurrentBackpack())
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] );
return;
Expand Down Expand Up @@ -3968,10 +3956,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )

if ( FindWindowJumpDirection( lSoldier, lSoldier->sGridNo, lSoldier->ubDirection, &bDirection ) )
{
if ((UsingNewInventorySystem() == true) && lSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)lSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[lSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[lSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!lSoldier->CanClimbWithCurrentBackpack())
{
//Moa: no jumping with backpack
//sAPCost = GetAPsToJumpThroughWindows( lSoldier, TRUE );
Expand Down Expand Up @@ -7606,11 +7591,7 @@ void HandleTBJump( void )
if ( fNearLowerLevel )
{
// CHRISL: Turn off manual jumping while wearing a backpack
if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

if (!pjSoldier->CanClimbWithCurrentBackpack())
return;

if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, TRUE ), GetBPsToClimbRoof( pjSoldier, TRUE ), FALSE ) )
Expand All @@ -7622,11 +7603,7 @@ void HandleTBJump( void )
if ( fNearHeigherLevel )
{
// No climbing when wearing a backpack!
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

if (!pjSoldier->CanClimbWithCurrentBackpack())
return;

if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, FALSE ), GetBPsToClimbRoof( pjSoldier, FALSE ), FALSE ) )
Expand All @@ -7638,11 +7615,7 @@ void HandleTBJump( void )
// Jump over fence
if ( FindFenceJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) )
{
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

if (!pjSoldier->CanClimbWithCurrentBackpack())
{
sAPCost = GetAPsToJumpFence( pjSoldier, TRUE );
sBPCost = GetBPsToJumpFence( pjSoldier, TRUE );
Expand All @@ -7665,11 +7638,7 @@ void HandleTBJump( void )
if ( FindWallJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) )
{
// No climbing when wearing a backpack!
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

if (!pjSoldier->CanClimbWithCurrentBackpack())
return;

if ( EnoughPoints( pjSoldier, GetAPsToJumpWall( pjSoldier, FALSE ), GetBPsToJumpWall( pjSoldier, FALSE ), FALSE ) )
Expand All @@ -7693,11 +7662,7 @@ void HandleTBJumpThroughWindow( void ){
{
if ( FindWindowJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) )
{
if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb)
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))

if (!pjSoldier->CanClimbWithCurrentBackpack())
{
sAPCost = GetAPsToJumpThroughWindows( pjSoldier, TRUE );
sBPCost = GetBPsToJumpThroughWindows( pjSoldier, TRUE );
Expand Down
5 changes: 1 addition & 4 deletions TacticalAI/AIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,7 @@ BOOLEAN IsActionAffordable(SOLDIERTYPE *pSoldier, INT8 bAction)
break;

case AI_ACTION_JUMP_WINDOW:
if((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true
//JMich.BackpackClimb
&& ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb )
&& ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE)))
if (!pSoldier->CanClimbWithCurrentBackpack())
bMinPointsNeeded = GetAPsToJumpThroughWindows( pSoldier, TRUE );
else
bMinPointsNeeded = GetAPsToJumpFence( pSoldier, FALSE );
Expand Down