mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Thread previous-tile movement mode into ActionPointCost
Add an ActionPointCost overload taking the previous tile's movement mode explicitly, used to charge the one-time start-run penalty. The existing 4-arg overload forwards the soldier's live anim state, so real per-step movement and every other caller are unchanged. This lets a path-cost estimator - which does not move the soldier - supply its simulated prior mode instead of reading a frozen live anim state, so the estimate and the real deduction can share one cost function. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
majcosta
co-authored by
Claude Opus 4.8
parent
4546bc1bf8
commit
de4e0d3dc7
+8
-1
@@ -391,6 +391,13 @@ INT16 TerrainBreathPoints(SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bDir, UINT
|
||||
|
||||
|
||||
INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 usMovementMode )
|
||||
{
|
||||
// Real, per-step movement: the soldier is physically at his current stance, so his
|
||||
// live anim state IS the previous tile's mode.
|
||||
return ActionPointCost( pSoldier, sGridNo, bDir, usMovementMode, pSoldier->usAnimState );
|
||||
}
|
||||
|
||||
INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 usMovementMode, UINT16 usPrevMovementMode )
|
||||
{
|
||||
INT16 sTileCost, sSwitchValue;
|
||||
FLOAT sPoints = 0;
|
||||
@@ -535,7 +542,7 @@ INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 u
|
||||
sPoints = max(1.0f, ( sPoints * (100 - (FLOAT)gSkillTraitValues.ubATAPsMovementReduction) / 100.0f ) );
|
||||
}
|
||||
|
||||
if (usMovementMode == RUNNING && pSoldier->usAnimState != RUNNING)
|
||||
if (usMovementMode == RUNNING && usPrevMovementMode != RUNNING)
|
||||
{
|
||||
// CHRISL
|
||||
if ((UsingNewInventorySystem() == true) && FindBackpackOnSoldier(pSoldier) != ITEM_NOT_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user