mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user