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
This commit is contained in:
Sevenfm
2021-04-24 12:52:39 +00:00
parent 23ce4caf26
commit fc91cb545a
+8 -2
View File
@@ -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;