Headrock found a bug in the CTH calculation with regards to autofire penalties.

Think I've fixed a glich where mercs who were already in a sector (but not active) could not be placed on the tactical placement screen (either because of an assertion error or simply being told the placement wasn't valid).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2385 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-10-28 18:41:22 +00:00
parent 7bd9d49e7c
commit 2eb729ab31
6 changed files with 26 additions and 16 deletions
+7 -3
View File
@@ -1040,7 +1040,7 @@ BOOLEAN LoadMapEdgepoints( INT8 **hBuffer )
return TRUE;
}
UINT16 ChooseMapEdgepoint( UINT8 ubStrategicInsertionCode )
UINT16 ChooseMapEdgepoint( UINT8 *ubStrategicInsertionCode, UINT8 lastValidICode )
{
INT16 *psArray=NULL;
UINT16 usArraySize=0;
@@ -1048,7 +1048,9 @@ UINT16 ChooseMapEdgepoint( UINT8 ubStrategicInsertionCode )
//First validate and get access to the correct array based on strategic direction.
//We will use the selected array to choose insertion gridno's.
switch( ubStrategicInsertionCode )
if( *ubStrategicInsertionCode == INSERTION_CODE_GRIDNO)
*ubStrategicInsertionCode = lastValidICode;
switch( *ubStrategicInsertionCode )
{
case INSERTION_CODE_NORTH:
psArray = gps1stNorthEdgepointArray;
@@ -1251,7 +1253,7 @@ void EndMapEdgepointSearch()
//THIS CODE ISN'T RECOMMENDED FOR TIME CRITICAL AREAS.
INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode )
INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode, UINT8 defaultICode, UINT8 *storedICode )
{
INT32 i, iDirectionLoop;
INT16 *psArray=NULL;
@@ -1263,6 +1265,8 @@ INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode
{ //Everything is reserved.
AssertMsg( 0, "All closest map edgepoints have been reserved. We should only have 20 soldiers maximum...");
}
if( ubInsertionCode == INSERTION_CODE_GRIDNO )
*storedICode = ubInsertionCode = defaultICode;
switch( ubInsertionCode )
{
case INSERTION_CODE_NORTH: