From fc91cb545a806f5f7e35e7a2db524a6be1d29542 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sat, 24 Apr 2021 12:52:39 +0000 Subject: [PATCH] Fixes bug when you sometimes got vision inside building when climbing from the roof (by Shadooow). Extended explanation: This happens from two reasons, first - there seems to be vision update for all soldiers every 5 seconds. Second, when climbing down the roof, the height level is set to 0 at the very beginning of the climb when merc is still on the roof - which makes him for a split second inside the building in fact. If the automatic vision update is triggered in this split of second, you will see into building. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8969 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Ani.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index 2fae654c..a45ce8af 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -242,8 +242,14 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) case 404: // MOVE GUY BACKWARD SOME VALUE + sNewGridNo = pSoldier->sGridNo; // Use same function as forward, but is -ve values! MoveMercFacingDirection( pSoldier , TRUE, (FLOAT)1 ); + //shadooow: since we just moved from original grid to the jump destination, now it is proper time to change bLevel + if (sNewGridNo != pSoldier->sGridNo) + { + pSoldier->pathing.bLevel = 0; + } break; case 405: @@ -349,8 +355,8 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) HandlePlacingRoofMarker( pSoldier, pSoldier->sGridNo, FALSE, TRUE ); pSoldier->EVENT_SetSoldierDesiredDirection( pSoldier->ubDirection ); - // Adjust height - pSoldier->SetSoldierHeight( (FLOAT)gClimbDownRoofStartDist[ pSoldier->ubBodyType ] ); + // Adjust height //shadooow: do not change bLevel yet, we are still at roof! + pSoldier->InternalSetSoldierHeight((FLOAT)gClimbDownRoofStartDist[pSoldier->ubBodyType], FALSE); // Adjust position MoveMercFacingDirection( pSoldier , TRUE, (FLOAT)3.5 ); break;