Fixed appearance of save game corruption when a game with different inventory set is loaded. Note that such games can still cause odd behavior and CTD's

Fixed old-style behavior when creating a soldier struct (caused memory corruption and leaks)
Fixed soldiers unable to fire if an error happened while firing the off-hand weapon
Fix animation system problems with soldiers interrupted while changing stance, such as twitching and not being able to navigate around obstacles
Prevent splitting money while an item is in the hand, which would result in losing the original item
Fix reverse of X,Y when checking visibility through a roof, which could make soldiers falsely visible/invisible
Prevent militia from simply waiting on the border when enemies are known to be in the sector
Fix stack overflow for soldier inventory debug display
Optimized A* pathing and cleaned up VS2K5 specific code
AI can now use all climb points for climbable buildings, not just a random few
Fix to not allow flat roof butted against slanted roof to be identified as a climb point
Prevent soldiers who cause an interrupt from a special action from continuing on their path after being interrupted
Prevent soldiers who enter or leave deep water from moving a space too far and turning back
Prevent soldiers from trying to crouch while in shallow water
Make soldier turn in the closest direction when he must get up from prone and turn then fall back to prone
Allow a soldier to swat for a tile before returning to prone if unable to return to prone immediately after a turn
Fix civilians that should show up in a sector, missing because of others that aren't
Fix a memset on a C++ class
Place Skyrider in a sector near his helecopter once available and the helicopter is present
Fix soldier corruption if too many shots burst-spread into too few tiles
Include both first and last tile in spread when some locations must be skipped
Fix to shoot at last location in burst
Fix to remove other previous spread locations when calculating a new spread
Fix to reload or rechamber off-hand when necessary, such as having a pistol shotgun in that hand


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1532 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-10-20 08:09:03 +00:00
parent eeb82168b5
commit dd0d6ea66d
35 changed files with 1322 additions and 863 deletions
+25 -8
View File
@@ -83,12 +83,21 @@ INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT16 sGridno, INT8 bDir, INT8
}
else if (IS_TRAVELCOST_DOOR( sSwitchValue ))
{
// Can't travel diagonally through a door
if (bDir & 1)
{
return -1;
}
sSwitchValue = DoorTravelCost( pSoldier, sGridno, (UINT8) sSwitchValue, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), NULL );
}
if (sSwitchValue >= TRAVELCOST_BLOCKED && sSwitchValue != TRAVELCOST_DOOR )
else if (gfPlotPathToExitGrid && sSwitchValue == TRAVELCOST_EXITGRID)
{
return(100); // Cost too much to be considered!
sSwitchValue = gTileTypeMovementCost[ gpWorldLevelData[ sGridno ].ubTerrainID ];
}
if (sSwitchValue >= TRAVELCOST_BLOCKED && sSwitchValue != TRAVELCOST_DOOR)
{
return(-1); // Cost too much to be considered!
}
switch( sSwitchValue )
@@ -115,7 +124,7 @@ INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT16 sGridno, INT8 bDir, INT8
case TRAVELCOST_VEINMID : sAPCost += AP_MOVEMENT_FLAT;
break;
*/
case TRAVELCOST_DOOR : sAPCost += AP_MOVEMENT_FLAT;
case TRAVELCOST_DOOR : sAPCost += AP_MOVEMENT_FLAT + AP_OPEN_DOOR + AP_OPEN_DOOR; // Include open and close costs!
break;
// cost for jumping a fence REPLACES all other AP costs!
@@ -265,6 +274,10 @@ INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bDir, UINT16 u
// get the tile cost for that tile based on WALKING
sTileCost = TerrainActionPoints( pSoldier, sGridNo, bDir, pSoldier->bLevel );
if (sTileCost == -1)
{
return 100;
}
// Get switch value...
sSwitchValue = gubWorldMovementCosts[ sGridNo ][ bDir ][ pSoldier->bLevel ];
@@ -343,6 +356,10 @@ INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bDir,
// get the tile cost for that tile based on WALKING
sTileCost = TerrainActionPoints( pSoldier, sGridNo, bDir, pSoldier->bLevel );
if (sTileCost == -1)
{
return 100;
}
// so, then we must modify it for other movement styles and accumulate
if (sTileCost > 0)
@@ -1484,7 +1501,7 @@ UINT8 MinAPsToPunch(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCost
INT8 MinPtsToMove(SOLDIERTYPE *pSoldier)
{
// look around all 8 directions and return lowest terrain cost
INT8 cnt;
UINT8 cnt;
INT16 sLowest=127;
INT16 sGridno,sCost;
@@ -1493,9 +1510,9 @@ INT8 MinPtsToMove(SOLDIERTYPE *pSoldier)
return( (INT8)sLowest);
}
for (cnt=0; cnt <= 7; cnt++)
for (cnt=0; cnt < 8; cnt++)
{
sGridno = NewGridNo(pSoldier->sGridNo, DirectionInc( cnt ));
sGridno = NewGridNo(pSoldier->sGridNo,DirectionInc(cnt));
if (sGridno != pSoldier->sGridNo)
{
if ( (sCost=ActionPointCost( pSoldier, sGridno, cnt , pSoldier->usUIMovementMode ) ) < sLowest )
@@ -1513,7 +1530,7 @@ INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection )
INT8 bOverTerrainType;
UINT16 usMoveModeToUse;
sGridno = NewGridNo( pSoldier->sGridNo, DirectionInc( bDirection ) );
sGridno = NewGridNo( pSoldier->sGridNo, DirectionInc(bDirection ) );
usMoveModeToUse = pSoldier->usUIMovementMode;