fixes for running over water

- merc will continue running after he walks out of last water tile
- fixed both pathing prediction AP cost calculation and an actual AP cost deduction when running into water and out of water

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9068 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-06-09 03:25:43 +00:00
parent 4b8a00f6e2
commit 807bd518b3
3 changed files with 30 additions and 5 deletions
+9
View File
@@ -4558,6 +4558,8 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
iLastGrid = giPathDataSize;
}
INT16 usMovementModeBefore = pSold->usAnimState;
for ( iCnt=0; iCnt < iLastGrid; iCnt++ )
{
sExtraCostStand = 0;
@@ -4586,6 +4588,13 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
usMovementModeToUseForAPs = WALKING;
}
//shadooow: moved inside loop because it can happen we (re)start running after we walked in water
if (sSwitchValue != TRAVELCOST_FENCE && usMovementModeToUseForAPs == RUNNING && usMovementModeBefore != RUNNING)
{
sPoints += GetAPsStartRun(pSold);
}
usMovementModeBefore = usMovementModeToUseForAPs;
// get the tile cost for that tile based on WALKING
sTileCost = TerrainActionPoints( pSold, sTempGrid, (INT8)guiPathingData[iCnt], pSold->pathing.bLevel );