mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix: Incorrect movement cost calculation for jumping over fences with obstacles behind them
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8640 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1016,11 +1016,18 @@ void CompileTileMovementCosts( INT32 usGridNo )
|
||||
SET_CURRMOVEMENTCOST( WEST, TRAVELCOST_OBSTACLE );
|
||||
SET_CURRMOVEMENTCOST( NORTHWEST, TRAVELCOST_OBSTACLE );
|
||||
// set values for the tiles EXITED from this location
|
||||
FORCE_SET_MOVEMENTCOST( usGridNo - WORLD_COLS, NORTH, 0, TRAVELCOST_NONE );
|
||||
// silversurfer: make sure that there is no obstacle in the target tile!
|
||||
if ( gubWorldMovementCosts[ usGridNo - WORLD_COLS ][ NORTH ][ 0 ] < TRAVELCOST_BLOCKED )
|
||||
{
|
||||
FORCE_SET_MOVEMENTCOST( usGridNo - WORLD_COLS, NORTH, 0, TRAVELCOST_NONE );
|
||||
}
|
||||
SET_MOVEMENTCOST( usGridNo - WORLD_COLS + 1, NORTHEAST, 0, TRAVELCOST_OBSTACLE );
|
||||
SET_MOVEMENTCOST( usGridNo + 1, EAST, 0, TRAVELCOST_OBSTACLE );
|
||||
SET_MOVEMENTCOST( usGridNo + WORLD_COLS + 1, SOUTHEAST, 0, TRAVELCOST_OBSTACLE );
|
||||
FORCE_SET_MOVEMENTCOST( usGridNo + WORLD_COLS, SOUTH, 0, TRAVELCOST_NONE );
|
||||
if ( gubWorldMovementCosts[ usGridNo + WORLD_COLS ][ SOUTH ][ 0 ] < TRAVELCOST_BLOCKED )
|
||||
{
|
||||
FORCE_SET_MOVEMENTCOST( usGridNo + WORLD_COLS, SOUTH, 0, TRAVELCOST_NONE );
|
||||
}
|
||||
SET_MOVEMENTCOST( usGridNo + WORLD_COLS - 1, SOUTHWEST, 0, TRAVELCOST_OBSTACLE );
|
||||
SET_MOVEMENTCOST( usGridNo - 1, WEST, 0, TRAVELCOST_OBSTACLE );
|
||||
SET_MOVEMENTCOST( usGridNo - WORLD_COLS - 1, NORTHWEST, 0, TRAVELCOST_OBSTACLE );
|
||||
|
||||
Reference in New Issue
Block a user