diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index 41f0bb35..3ff3d696 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -958,15 +958,15 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) //CODE: BEGINHOPFENCE // MOVE TWO FACGIN GRIDNOS - sNewGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)( DirectionInc( pSoldier->ubDirection ) ) ); - //ddd window{ - if ( gubWorldMovementCosts[ sNewGridNo ][ (UINT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ] ][ pSoldier->pathing.bLevel ] == TRAVELCOST_FENCE ) - sNewGridNo = NewGridNo( sNewGridNo, (UINT16)( DirectionInc( pSoldier->ubDirection ) ) ); - //ddd window} + // Flugente: the old complicaed method relied on pSoldier->pathing.usPathingData to be filled correctly - which it often wasn't. + // This is unneccessary, as we've already filled sTempNewGridNo with the correct data + // we could fill sForcastGridno when initiating the jump, but lets keep this as a hook + if ( pSoldier->sTempNewGridNo != NOWHERE ) + pSoldier->sForcastGridno = pSoldier->sTempNewGridNo; + else + // hey, it's better than nowhere + pSoldier->sForcastGridno = pSoldier->sGridNo; - //comm by ddd - //sNewGridNo = NewGridNo( sNewGridNo, (UINT16)( DirectionInc( pSoldier->ubDirection ) ) ); - pSoldier->sForcastGridno = sNewGridNo; break; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 459d8ed2..860a5e6a 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -6998,7 +6998,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT32 sDestGridNo, UINT16 } else { - this->pathing.usPathDataSize++; + ++this->pathing.usPathDataSize; } } @@ -9339,6 +9339,10 @@ void SOLDIERTYPE::BeginSoldierClimbFence( void ) if ( FindFenceJumpDirection( this, this->sGridNo, bDirection, &bDirection ) ) { this->sTempNewGridNo = NewGridNo( this->sGridNo, (UINT16)DirectionInc( bDirection ) ); + + // Flugente: we want to jump OVER the structure, not INTO it! + this->sTempNewGridNo = NewGridNo( this->sTempNewGridNo, (UINT16)DirectionInc( bDirection ) ); + this->flags.fDontChargeTurningAPs = TRUE; EVENT_InternalSetSoldierDesiredDirection( this, bDirection, FALSE, this->usAnimState ); this->flags.fTurningUntilDone = TRUE; @@ -9346,7 +9350,6 @@ void SOLDIERTYPE::BeginSoldierClimbFence( void ) this->flags.bTurningFromPronePosition = TURNING_FROM_PRONE_OFF; this->usPendingAnimation = HOPFENCE; } - } //---legion by JAzz--------------------------------------- diff --git a/Tactical/Structure Wrap.cpp b/Tactical/Structure Wrap.cpp index 4ce71659..d4b64329 100644 --- a/Tactical/Structure Wrap.cpp +++ b/Tactical/Structure Wrap.cpp @@ -146,7 +146,7 @@ BOOLEAN IsJumpableFencePresentAtGridNo( INT32 sGridNo ) { return( TRUE ); } - if ( pStructure->pDBStructureRef->pDBStructure->ubArmour == MATERIAL_SANDBAG && StructureHeight( pStructure ) < 2 ) + if ( pStructure->pDBStructureRef->pDBStructure->ubArmour == MATERIAL_SANDBAG && StructureHeight( pStructure ) <= 2 ) { return( TRUE ); } diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 983a7dd5..cc8a937e 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -3489,11 +3489,14 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] ); return; } + if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, TRUE ), GetBPsToClimbRoof( pjSoldier, TRUE ), FALSE ) ) { pjSoldier->BeginSoldierClimbDownRoof( ); + return; } } + if ( fNearHeigherLevel ) { // No climbing when wearing a backpack! @@ -3505,9 +3508,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] ); return; } + if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, FALSE ), GetBPsToClimbRoof( pjSoldier, FALSE ), FALSE ) ) { pjSoldier->BeginSoldierClimbUpRoof( ); + return; } } @@ -3534,6 +3539,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) if ( EnoughPoints( pjSoldier, sAPCost, sBPCost, FALSE ) ) { pjSoldier->BeginSoldierClimbFence( ); + return; } } @@ -3549,11 +3555,13 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] ); return; } + if ( FindWallJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) { if ( EnoughPoints( pjSoldier, GetAPsToJumpWall( pjSoldier, FALSE ), GetBPsToJumpWall( pjSoldier, FALSE ), FALSE ) ) { pjSoldier->BeginSoldierClimbWall( ); + return; } } } diff --git a/TileEngine/worlddef.cpp b/TileEngine/worlddef.cpp index 2ae1ee61..7c2b9678 100644 --- a/TileEngine/worlddef.cpp +++ b/TileEngine/worlddef.cpp @@ -1066,7 +1066,7 @@ void CompileTileMovementCosts( INT32 usGridNo ) break; } } - else if ( pStructure->pDBStructureRef->pDBStructure->ubArmour == MATERIAL_SANDBAG && StructureHeight( pStructure ) < 2 ) + else if ( pStructure->pDBStructureRef->pDBStructure->ubArmour == MATERIAL_SANDBAG && StructureHeight( pStructure ) <= 2 ) { for (ubDirLoop=0; ubDirLoop < NUM_WORLD_DIRECTIONS; ubDirLoop++) {