Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Ja2/gamescreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,14 @@ UINT32 MainGameScreenHandle(void)
InternalLocateGridNo( gGameUBOptions.LOCATEGRIDNO, TRUE );
}
#else
if (gfFirstHeliRun)
{
InternalLocateGridNo( gGameExternalOptions.iInitialMercArrivalLocation, TRUE );
}
else
{
InternalLocateGridNo(gMapInformation.sCenterGridNo, TRUE);
}
#endif
// Flugente: we might have reloaded the game, so we are currently not dropping mercs out of a helicopter
gfIngagedInDrop = FALSE;
Expand Down
27 changes: 11 additions & 16 deletions Strategic/strategicmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3382,27 +3382,22 @@ void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY,
break;

case INSERTION_CODE_ARRIVING_GAME:
// Are we in Omerta!
if ( sSectorX == gWorldSectorX && gWorldSectorX == 9 && sSectorY == gWorldSectorY && gWorldSectorY == 1 && bSectorZ == gbWorldSectorZ && gbWorldSectorZ == 0 )
{
// TODO.WANNE: Hardcoded grid number
// Try another location and walk into map
pSoldier->sInsertionGridNo = 4379;//dnl!!!
}
else
{
#ifdef JA2UB
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
//pSoldier->sInsertionGridNo = gMapInformation.sNorthGridNo;
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
pSoldier->sInsertionGridNo = gGameUBOptions.LOCATEGRIDNO;
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
pSoldier->sInsertionGridNo = gGameUBOptions.LOCATEGRIDNO;
#else
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
//pSoldier->sInsertionGridNo = gMapInformation.sNorthGridNo;
extern BOOLEAN gfFirstHeliRun;
if (gfFirstHeliRun)
{
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
pSoldier->sInsertionGridNo = gGameExternalOptions.iInitialMercArrivalLocation;
#endif
}
else
{
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
pSoldier->sInsertionGridNo = gMapInformation.sCenterGridNo;
}
#endif
break;
case INSERTION_CODE_CHOPPER:
// Try another location and walk into map
Expand Down
29 changes: 15 additions & 14 deletions Tactical/Merc Entering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,27 +1038,28 @@ UINT8 SpawnAirDropElite( INT32 sGridNo )

// Flugente hack
pSoldier = TacticalCreateEliteEnemy( );
if ( pSoldier == nullptr)
{
return NOBODY;
}

//Add soldier strategic info, so it doesn't break the counters!
if ( pSoldier )
if ( !gbWorldSectorZ )
{
if ( !gbWorldSectorZ )
SECTORINFO *pSector = &SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )];
switch ( pSoldier->ubSoldierClass )
{
SECTORINFO *pSector = &SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )];
switch ( pSoldier->ubSoldierClass )
{
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
}
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
}

pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
pSoldier->usStrategicInsertionData = sGridNo; // required, otherwise soldiers will spawn in map before jumping out of the heli
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
//AllTeamsLookForAll( NO_INTERRUPTS );
}

pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
pSoldier->usStrategicInsertionData = sGridNo; // required, otherwise soldiers will spawn in map before jumping out of the heli
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
//AllTeamsLookForAll( NO_INTERRUPTS );

return pSoldier->ubID;
}

Expand Down
21 changes: 13 additions & 8 deletions Tactical/Merc Hiring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "DynamicDialogue.h"// added by Flugente
#include "Dialogue Control.h" // added by Flugente
#include "connect.h"
#include "Map Information.h"

#ifdef JA2UB
#include "Soldier Control.h"
Expand Down Expand Up @@ -534,16 +535,23 @@ void MercArrivesCallback( UINT8 ubSoldierID )
#ifdef JA2UB
if ( pSoldier->ubStrategicInsertionCode != INSERTION_CODE_CHOPPER && pSoldier->sSectorX == gGameExternalOptions.ubDefaultArrivalSectorX && pSoldier->sSectorY == gGameExternalOptions.ubDefaultArrivalSectorY && gGameUBOptions.InGameHeli == TRUE )
#else
if ( pSoldier->ubStrategicInsertionCode != INSERTION_CODE_CHOPPER && pSoldier->sSectorX == gGameExternalOptions.ubDefaultArrivalSectorX && pSoldier->sSectorY == gGameExternalOptions.ubDefaultArrivalSectorY )
if (pSoldier->ubStrategicInsertionCode != INSERTION_CODE_CHOPPER )
#endif
{
gfTacticalDoHeliRun = TRUE;
SetHelicopterDroppoint(gGameExternalOptions.iInitialMercArrivalLocation);
if (gfFirstHeliRun)
{
SetHelicopterDroppoint(gGameExternalOptions.iInitialMercArrivalLocation);
}
else
{
SetHelicopterDroppoint(gMapInformation.sCenterGridNo);
}

// OK, If we are in mapscreen, get out...
if ( guiCurrentScreen == MAP_SCREEN )
{
// ATE: Make sure the current one is selected!
// ATE: Make sure the current one is selected!
ChangeSelectedMapSector( gWorldSectorX, gWorldSectorY, 0 );

RequestTriggerExitFromMapscreen( MAP_EXIT_TO_TACTICAL );
Expand All @@ -554,17 +562,14 @@ void MercArrivesCallback( UINT8 ubSoldierID )

UpdateMercInSector( pSoldier, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
}
// Strategic map arrival to a sector that's not loaded
else
{
// OK, otherwise, set them in north area, so once we load again, they are here.
#ifdef JA2UB
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
pSoldier->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
#else
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
pSoldier->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
#endif
}

Expand Down