mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Driveable vehicle update (by anv)
- Vehicles can now exit sector in tactical screen. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4557,9 +4557,15 @@ UINT8 FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKL
|
||||
SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT32 cnt, cnt2;
|
||||
|
||||
// anv: soldier's "assignment" can be a vehicle, not a proper squad, causing out-of-range in second loop
|
||||
INT8 bMaxSquad = pSoldier->bAssignment;
|
||||
if( bMaxSquad >= NUMBER_OF_SQUADS )
|
||||
{
|
||||
bMaxSquad = NUMBER_OF_SQUADS - 1;
|
||||
}
|
||||
|
||||
|
||||
for( cnt = pSoldier->bAssignment + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
||||
for( cnt = bMaxSquad + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
||||
{
|
||||
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||
{
|
||||
@@ -4572,7 +4578,7 @@ SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// none found,
|
||||
// Now loop back
|
||||
for( cnt = 0; cnt <= pSoldier->bAssignment; cnt++ )
|
||||
for( cnt = 0; cnt <= bMaxSquad; cnt++ )
|
||||
{
|
||||
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||
{
|
||||
|
||||
@@ -181,6 +181,17 @@ BOOLEAN InternalInitSectorExitMenu( UINT8 ubDirection, INT32 sAdditionalData )//
|
||||
gExitDialog.fAllMove = TRUE;
|
||||
}
|
||||
|
||||
// anv: vehicle always move with all passengers inside
|
||||
if( MercPtrs[gusSelectedSoldier]->bAssignment == VEHICLE )
|
||||
{
|
||||
gExitDialog.fSingleMoveDisabled = TRUE;
|
||||
gExitDialog.fSingleMoveOn = FALSE;
|
||||
gExitDialog.fSingleMove = FALSE;
|
||||
gExitDialog.fAllMoveDisabled = FALSE;
|
||||
gExitDialog.fAllMoveOn = TRUE;
|
||||
gExitDialog.fAllMove = TRUE;
|
||||
}
|
||||
|
||||
if ( gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
INT32 i, cnt = 0;
|
||||
@@ -224,11 +235,14 @@ BOOLEAN InternalInitSectorExitMenu( UINT8 ubDirection, INT32 sAdditionalData )//
|
||||
if( !pSoldier->flags.fBetweenSectors &&
|
||||
pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ &&
|
||||
pSoldier->stats.bLife >= OKLIFE &&
|
||||
pSoldier->bAssignment != MercPtrs[ gusSelectedSoldier ]->bAssignment &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD )
|
||||
( pSoldier->bAssignment != MercPtrs[ gusSelectedSoldier ]->bAssignment ||
|
||||
( pSoldier->bAssignment == VEHICLE && pSoldier->iVehicleId != MercPtrs[ gusSelectedSoldier ]->iVehicleId ) ) &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD
|
||||
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||
{ //KM: We need to determine if there are more than one squad (meaning other concious mercs in a different squad or assignment)
|
||||
// These conditions were done to the best of my knowledge, so if there are other situations that require modification,
|
||||
// then feel free to do so.
|
||||
// anv: added skipping vehicles and checking if soldiers on the same assignment aren't just in two different vehicles
|
||||
gExitDialog.fMultipleSquadsInSector = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user