mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +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:
@@ -4089,7 +4089,12 @@ void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32
|
|||||||
curr = pGroup->pPlayerList;
|
curr = pGroup->pPlayerList;
|
||||||
while( curr )
|
while( curr )
|
||||||
{
|
{
|
||||||
if ( OK_CONTROLLABLE_MERC( curr->pSoldier) )
|
// anv: passengers can't move anyway
|
||||||
|
if( curr->pSoldier->bAssignment == VEHICLE )
|
||||||
|
{
|
||||||
|
curr->pSoldier->ubWaitActionToDo = 0;
|
||||||
|
}
|
||||||
|
else if ( OK_CONTROLLABLE_MERC( curr->pSoldier ) )
|
||||||
{
|
{
|
||||||
if ( ubTacticalDirection != 255 )
|
if ( ubTacticalDirection != 255 )
|
||||||
{
|
{
|
||||||
@@ -4784,6 +4789,12 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// anv: vehicles can't use inner exit grids
|
||||||
|
if( bExitDirection == (-1) && MercPtrs[gusSelectedSoldier]->bAssignment == VEHICLE )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//Exception code for the two sectors in San Mona that are separated by a cliff. We want to allow strategic
|
//Exception code for the two sectors in San Mona that are separated by a cliff. We want to allow strategic
|
||||||
//traversal, but NOT tactical traversal. The only way to tactically go from D4 to D5 (or viceversa) is to enter
|
//traversal, but NOT tactical traversal. The only way to tactically go from D4 to D5 (or viceversa) is to enter
|
||||||
@@ -4812,7 +4823,9 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||||
{
|
{
|
||||||
// If we are controllable
|
// If we are controllable
|
||||||
if ( OK_CONTROLLABLE_MERC( pSoldier) && pSoldier->bAssignment == CurrentSquad( ) )
|
//if ( OK_CONTROLLABLE_MERC( pSoldier) && pSoldier->bAssignment == CurrentSquad( ) )
|
||||||
|
if ( OK_CONTROLLABLE_MERC( pSoldier) && ( pSoldier->bAssignment == CurrentSquad( ) ||
|
||||||
|
( pSoldier->bAssignment == VEHICLE && GetSoldierStructureForVehicle(pSoldier->iVehicleId)->bAssignment == CurrentSquad( ) ) ) )
|
||||||
{
|
{
|
||||||
//Need to keep a copy of a good soldier, so we can access it later, and
|
//Need to keep a copy of a good soldier, so we can access it later, and
|
||||||
//not more than once.
|
//not more than once.
|
||||||
|
|||||||
@@ -4557,9 +4557,15 @@ UINT8 FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKL
|
|||||||
SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
INT32 cnt, cnt2;
|
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 = bMaxSquad + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
||||||
for( cnt = pSoldier->bAssignment + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
|
||||||
{
|
{
|
||||||
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||||
{
|
{
|
||||||
@@ -4572,7 +4578,7 @@ SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
// none found,
|
// none found,
|
||||||
// Now loop back
|
// 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++ )
|
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,6 +181,17 @@ BOOLEAN InternalInitSectorExitMenu( UINT8 ubDirection, INT32 sAdditionalData )//
|
|||||||
gExitDialog.fAllMove = TRUE;
|
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 )
|
if ( gTacticalStatus.uiFlags & INCOMBAT )
|
||||||
{
|
{
|
||||||
INT32 i, cnt = 0;
|
INT32 i, cnt = 0;
|
||||||
@@ -224,11 +235,14 @@ BOOLEAN InternalInitSectorExitMenu( UINT8 ubDirection, INT32 sAdditionalData )//
|
|||||||
if( !pSoldier->flags.fBetweenSectors &&
|
if( !pSoldier->flags.fBetweenSectors &&
|
||||||
pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ &&
|
pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ &&
|
||||||
pSoldier->stats.bLife >= OKLIFE &&
|
pSoldier->stats.bLife >= OKLIFE &&
|
||||||
pSoldier->bAssignment != MercPtrs[ gusSelectedSoldier ]->bAssignment &&
|
( pSoldier->bAssignment != MercPtrs[ gusSelectedSoldier ]->bAssignment ||
|
||||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD )
|
( 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)
|
{ //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,
|
// 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.
|
// 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;
|
gExitDialog.fMultipleSquadsInSector = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user