fixed POW code throwing errors when trying to compile UB build

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9101 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-06-23 23:04:49 +00:00
parent 749854b24f
commit dce924540f
4 changed files with 26 additions and 10 deletions
+2 -1
View File
@@ -533,12 +533,13 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
{
gubQuest[QUEST_HELD_IN_ALMA] = QUESTNOTSTARTED;
}
#ifndef JA2UB
//shadooow: re-enable quest if player loses control of the Tixa prison and quest was disabled previously
if (sMapX == gModSettings.ubTixaPrisonSectorX && sMapY == gModSettings.ubTixaPrisonSectorY && gubQuest[QUEST_HELD_IN_TIXA] == QUESTCANNOTSTART)
{
gubQuest[QUEST_HELD_IN_TIXA] = QUESTNOTSTARTED;
}
#endif
// Flugente: reduce workforce
SectorInfo[SECTOR( sMapX, sMapY )].usWorkers = SectorInfo[SECTOR( sMapX, sMapY )].usWorkers * gGameExternalOptions.dInitialWorkerRate;
+8 -6
View File
@@ -2807,18 +2807,16 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
}
ChangeSoldiersAssignment( pSoldier, ASSIGNMENT_POW );
// ATE: Make them neutral!
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
pSoldier->aiData.bNeutral = TRUE;
}
RemoveCharacterFromSquads( pSoldier );
WORLDITEM WorldItem;
std::vector<WORLDITEM> pWorldItem;
#ifdef JA2UB
if (gStrategicStatus.ubNumCapturedForRescue < 3 && (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
#else
if (gStrategicStatus.ubNumCapturedForRescue < 3 && (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
#endif
{
INT32 itemdropoffgridno = -1;
@@ -2826,21 +2824,25 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED )
{
//-teleport him to NE Alma sector (not Tixa as originally planned)
pSoldier->aiData.bNeutral = TRUE;
pSoldier->sSectorX = gModSettings.ubInitialPOWSectorX; //13
pSoldier->sSectorY = gModSettings.ubInitialPOWSectorY; //9
pSoldier->bSectorZ = 0;
pSoldier->usStrategicInsertionData = gModSettings.iInitialPOWGridNo[gStrategicStatus.ubNumCapturedForRescue];
itemdropoffgridno = gModSettings.iInitialPOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];
}
#ifndef JA2UB
else if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
//-teleport him to Tixa as originally planned
pSoldier->aiData.bNeutral = TRUE;
pSoldier->sSectorX = gModSettings.ubTixaPrisonSectorX;
pSoldier->sSectorY = gModSettings.ubTixaPrisonSectorY;
pSoldier->bSectorZ = 0;
pSoldier->usStrategicInsertionData = gModSettings.iTixaPrisonPOWGridNo[gStrategicStatus.ubNumCapturedForRescue];
itemdropoffgridno = gModSettings.iTixaPrisonPOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];
}
#endif
else //if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTDONE )
{
//-teleport him to N7
+2
View File
@@ -3304,6 +3304,7 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
// Do action
HandleNPCDoAction( 0, NPC_ACTION_GRANT_EXPERIENCE_3, 0 );
}
#ifndef JA2UB
else if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTINPROGRESS)
{
// Complete quest
@@ -3312,6 +3313,7 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
// Do action
HandleNPCDoAction(0, NPC_ACTION_GRANT_EXPERIENCE_3, 0);
}
#endif
}
}
}
+14 -3
View File
@@ -7618,12 +7618,14 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
{
gubQuest[QUEST_HELD_IN_ALMA] = QUESTNOTSTARTED;
}
#ifndef JA2UB
//shadooow: re-enable quest if player loses control of the Tixa prison and quest was disabled previously
if (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY &&
gbWorldSectorZ == 0 && gubQuest[QUEST_HELD_IN_TIXA] == QUESTCANNOTSTART)
{
gubQuest[QUEST_HELD_IN_TIXA] = QUESTNOTSTARTED;
}
#endif
// Play death music
#ifdef NEWMUSIC
@@ -7848,7 +7850,8 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
gubQuest[QUEST_HELD_IN_ALMA] = QUESTCANNOTSTART;
}
}
//shadooow: disable quest if player takes control of the Alma prison
#ifndef JA2UB
//shadooow: disable quest if player takes control of the Tixa prison
if (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY &&
gbWorldSectorZ == 0 && gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
@@ -7862,7 +7865,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
gubQuest[QUEST_HELD_IN_TIXA] = QUESTCANNOTSTART;
}
}
#endif
// Say battle end quote....
if (fAnEnemyRetreated)
@@ -8585,7 +8588,11 @@ BOOLEAN CheckForLosingEndOfBattle( )
{
//if( GetWorldDay() > STARTDAY_ALLOW_PLAYER_CAPTURE_FOR_RESCUE && !( gStrategicStatus.uiFlags & STRATEGIC_PLAYER_CAPTURED_FOR_RESCUE ))
{
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) )
#ifdef JA2UB
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
#else
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) )
#endif
{
fDoCapture = TRUE;
// CJC Dec 1 2002: fix capture sequences
@@ -11264,7 +11271,11 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
// in order for this to work, there must be no militia present, the enemy must not already have offered asked you to surrender, and certain quests may not be active
if ( !( gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER ) && gTacticalStatus.Team[ MILITIA_TEAM ].bMenInSector == 0 )
{
#ifdef JA2UB
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
#else
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
#endif
{
gTacticalStatus.fEnemyFlags |= ENEMY_OFFERED_SURRENDER;