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
@@ -282,6 +282,13 @@ INT16 BaseAPsToShootOrStabNoModifier( INT16 bAPs, INT16 bAimSkill, OBJECTTYPE *
|
||||
INT16 BaseAPsToShootOrStabNoModifier( INT16 bAPs, INT16 bAimSkill, OBJECTTYPE * pObj );
|
||||
|
||||
INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT32 sGridno, INT8 bDir, INT8 bLevel );
|
||||
// Per-tile movement AP cost - the single source of truth for what a step costs.
|
||||
// usPrevMovementMode is the mode the soldier was in on the PREVIOUS tile, used to
|
||||
// charge the one-time "spin up to run" penalty exactly once. Real movement passes
|
||||
// the soldier's live anim state; a path estimator must pass its simulated prior mode,
|
||||
// because the soldier doesn't actually move while the path is being summed.
|
||||
INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 usMovementMode, UINT16 usPrevMovementMode );
|
||||
// Convenience overload: prev mode = the soldier's current anim state (correct for real, per-step movement).
|
||||
INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 usMovementMode );
|
||||
INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 usMovementMode, INT8 bPathIndex, INT8 bPathLength );
|
||||
BOOLEAN SelectedMercCanAffordMove( );
|
||||
|
||||
Reference in New Issue
Block a user