mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
- If ALLOW_MILITIA_STRATEGIC_COMMAND is TRUE and militia can be commanded, oen can order them to retreat from autoresolve
- Final sector in a militia group's path is shown while plotting in the strategic map. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7743 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1221,10 +1221,28 @@ INT16 GetLastSectorIdInVehiclePath( INT32 iId )
|
||||
}
|
||||
|
||||
return sLastSector;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// get id of last sector in group'S path list
|
||||
INT16 GetLastSectorIdInMilitiaGroupPath( UINT8 uGroupId )
|
||||
{
|
||||
INT16 sLastSector = -1;
|
||||
|
||||
INT16 militiapathslot = GetMilitiaPathSlot( uGroupId );
|
||||
|
||||
if ( militiapathslot > -1 )
|
||||
{
|
||||
PathStPtr pNode = gMilitiaPath[militiapathslot].path;
|
||||
|
||||
while ( pNode )
|
||||
{
|
||||
sLastSector = (INT16)(pNode->uiSectorId);
|
||||
pNode = pNode->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
return sLastSector;
|
||||
}
|
||||
|
||||
|
||||
PathStPtr CopyPaths( PathStPtr pSourcePath, PathStPtr pDestPath )
|
||||
@@ -1974,32 +1992,44 @@ void ClearMercPathsAndWaypointsForAllInGroup( GROUP *pGroup )
|
||||
PLAYERGROUP *pPlayer = NULL;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
pPlayer = pGroup->pPlayerList;
|
||||
while( pPlayer )
|
||||
if ( pGroup->usGroupTeam == OUR_TEAM )
|
||||
{
|
||||
pSoldier = pPlayer->pSoldier;
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
pPlayer = pGroup->pPlayerList;
|
||||
while( pPlayer )
|
||||
{
|
||||
ClearPathForSoldier( pSoldier );
|
||||
pSoldier = pPlayer->pSoldier;
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
ClearPathForSoldier( pSoldier );
|
||||
}
|
||||
|
||||
pPlayer = pPlayer->next;
|
||||
}
|
||||
|
||||
pPlayer = pPlayer->next;
|
||||
// if it's a vehicle
|
||||
if ( pGroup->fVehicle )
|
||||
{
|
||||
INT32 iVehicleId = -1;
|
||||
VEHICLETYPE *pVehicle = NULL;
|
||||
|
||||
iVehicleId = GivenMvtGroupIdFindVehicleId( pGroup->ubGroupID );
|
||||
Assert ( iVehicleId != -1 );
|
||||
|
||||
pVehicle = &( pVehicleList[ iVehicleId ] );
|
||||
|
||||
// clear the path for that vehicle
|
||||
pVehicle->pMercPath = ClearStrategicPathList( pVehicle->pMercPath, pVehicle->ubMovementGroup );
|
||||
}
|
||||
}
|
||||
|
||||
// if it's a vehicle
|
||||
if ( pGroup->fVehicle )
|
||||
else if ( pGroup->usGroupTeam == MILITIA_TEAM )
|
||||
{
|
||||
INT32 iVehicleId = -1;
|
||||
VEHICLETYPE *pVehicle = NULL;
|
||||
INT16 militiapathslot = GetMilitiaPathSlot( pGroup->ubGroupID );
|
||||
|
||||
iVehicleId = GivenMvtGroupIdFindVehicleId( pGroup->ubGroupID );
|
||||
Assert ( iVehicleId != -1 );
|
||||
|
||||
pVehicle = &( pVehicleList[ iVehicleId ] );
|
||||
|
||||
// clear the path for that vehicle
|
||||
pVehicle->pMercPath = ClearStrategicPathList( pVehicle->pMercPath, pVehicle->ubMovementGroup );
|
||||
if ( militiapathslot > -1 )
|
||||
{
|
||||
gMilitiaPath[militiapathslot].path = ClearStrategicPathList( gMilitiaPath[militiapathslot].path, pGroup->ubGroupID );
|
||||
}
|
||||
}
|
||||
|
||||
// clear the waypoints for this group too - no mercpath = no waypoints!
|
||||
|
||||
Reference in New Issue
Block a user