mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -907,14 +907,16 @@ void KillTacticalPlacementGUI()
|
||||
void ChooseRandomEdgepoints()
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 lastValidICode = INSERTION_CODE_GRIDNO;
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
if ( !( gMercPlacement[ i ].pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
{
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = ChooseMapEdgepoint( gMercPlacement[ i ].ubStrategicInsertionCode );
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = ChooseMapEdgepoint( &gMercPlacement[ i ].ubStrategicInsertionCode, lastValidICode );
|
||||
if( gMercPlacement[ i ].pSoldier->usStrategicInsertionData != NOWHERE )
|
||||
{
|
||||
gMercPlacement[ i ].pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
lastValidICode = gMercPlacement[ i ].ubStrategicInsertionCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1109,6 +1111,7 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
INT32 i;
|
||||
INT16 sGridNo;
|
||||
BOOLEAN fInvalidArea = FALSE;
|
||||
UINT8 lastValidICode = INSERTION_CODE_GRIDNO;
|
||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{ //if we have a selected merc, move him to the new closest map edgepoint of his side.
|
||||
if( gfValidCursor )
|
||||
@@ -1127,12 +1130,14 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
//the problem. If everything's okay, we will place them all.
|
||||
if( gMercPlacement[ i ].pSoldier->ubGroupID == gubSelectedGroupID )
|
||||
{
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = SearchForClosestPrimaryMapEdgepoint( sGridNo, gMercPlacement[ i ].ubStrategicInsertionCode );
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = SearchForClosestPrimaryMapEdgepoint( sGridNo, gMercPlacement[ i ].ubStrategicInsertionCode, lastValidICode, &gMercPlacement[ i ].ubStrategicInsertionCode );
|
||||
if( gMercPlacement[ i ].pSoldier->usStrategicInsertionData == NOWHERE )
|
||||
{
|
||||
fInvalidArea = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
lastValidICode = gMercPlacement[ i ].ubStrategicInsertionCode;
|
||||
}
|
||||
}
|
||||
if( !fInvalidArea )
|
||||
|
||||
Reference in New Issue
Block a user