mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
UB 1.13 Fixes (by Jazz)
- The problem was fixed with the mark of underground sectors on the strategic map (J14-1,K14-1,L15-2,L15-3). - Fixed the problem with moving from the sector K14-1 to K15-1. - Procedure HandleMovingTheEnemiesToBeNearPlayerWhenEnteringComplexMap was blocked in the file strategicamp.cpp. - Added a few new parameters to the file UB_Options.ini git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8096 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7159,7 +7159,7 @@ void HandleSectorSpecificModificatioToMap( INT16 sMapX, INT16 sMapY, INT8 bMapZ,
|
||||
// MakeAllTeamMembersCrouchedThenStand();
|
||||
|
||||
//If the player made noise in the tunnel, enemies should be placed near them
|
||||
HandleMovingTheEnemiesToBeNearPlayerWhenEnteringComplexMap( );
|
||||
//HandleMovingTheEnemiesToBeNearPlayerWhenEnteringComplexMap(); //is Disabled. The problem of moving from K14_1 to K15_1.
|
||||
|
||||
//if the big door should be opened
|
||||
HandleFortifiedDoor( );
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
#include "LOS.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Ja25Update.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
@@ -5513,11 +5514,11 @@ void CheckForValidQuotesWhenLeavingDealer( UINT8 ubProfile )
|
||||
// This function checks if we should replace the mine entrance graphic
|
||||
BOOLEAN IsMineEntranceInSectorI13AtThisGridNo( UINT32 sGridNo )
|
||||
{
|
||||
// First check current sector......
|
||||
if( gWorldSectorX == 13 && gWorldSectorY == MAP_ROW_I && gbWorldSectorZ == 0 )
|
||||
// First check current sector...... I13
|
||||
if( gWorldSectorX == gGameUBOptions.MineSectorX && gWorldSectorY == gGameUBOptions.MineSectorY && gbWorldSectorZ == gGameUBOptions.MineSectorZ )
|
||||
{
|
||||
//if this is the right gridno
|
||||
if( sGridNo == 12421 )
|
||||
if( sGridNo == gGameUBOptions.MineEntranceGridno )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -5543,7 +5544,7 @@ void HaveBiggensDetonatingExplosivesByTheMine()
|
||||
void ReplaceMineEntranceGraphicWithCollapsedEntrance()
|
||||
{
|
||||
UINT16 usTileIndex;
|
||||
UINT32 usGridNo=12745;
|
||||
UINT32 usGridNo = gGameUBOptions.MineGridnoAddStructToHead; //12745;
|
||||
|
||||
//Make sure wed ont blow things up twice
|
||||
//off
|
||||
@@ -5563,10 +5564,10 @@ void ReplaceMineEntranceGraphicWithCollapsedEntrance()
|
||||
AddStructToHead( usGridNo, usTileIndex );
|
||||
|
||||
//remove the exit grid from the world
|
||||
RemoveExitGridFromWorld( 12422 );
|
||||
RemoveExitGridFromWorld( 12423 );
|
||||
AddRemoveExitGridToUnloadedMapTempFile( 12422, 13, MAP_ROW_I, 0 );
|
||||
AddRemoveExitGridToUnloadedMapTempFile( 12423, 13, MAP_ROW_I, 0 );
|
||||
RemoveExitGridFromWorld( gGameUBOptions.MineRemoveExitGridFromWorld1 );
|
||||
RemoveExitGridFromWorld( gGameUBOptions.MineRemoveExitGridFromWorld2 );
|
||||
AddRemoveExitGridToUnloadedMapTempFile( gGameUBOptions.MineRemoveExitGridFromWorld1 , gGameUBOptions.MineSectorX, gGameUBOptions.MineSectorY, gGameUBOptions.MineSectorZ ); //I13
|
||||
AddRemoveExitGridToUnloadedMapTempFile( gGameUBOptions.MineRemoveExitGridFromWorld2 , gGameUBOptions.MineSectorX, gGameUBOptions.MineSectorY, gGameUBOptions.MineSectorZ ); //I13
|
||||
|
||||
gpWorldLevelData[ usGridNo ].uiFlags |= MAPELEMENT_REVEALED;
|
||||
|
||||
@@ -5591,37 +5592,37 @@ void ReplaceMineEntranceGraphicWithCollapsedEntrance()
|
||||
//Remove the old tunnel pieces first
|
||||
|
||||
//First half of entrance
|
||||
usGridNo = 13057;
|
||||
usGridNo = gGameUBOptions.MineSectorUndergroundGridno1; //13057;
|
||||
|
||||
// Get index for it...
|
||||
GetTileIndexFromTypeSubIndex( FIRSTDECORATIONS, (INT8)( 1 ), &usTileIndex );
|
||||
|
||||
RemoveStructFromUnLoadedMapTempFile( usGridNo, usTileIndex, 13, MAP_ROW_I, 1 );
|
||||
RemoveStructFromUnLoadedMapTempFile( usGridNo, usTileIndex,gGameUBOptions.MineSectorUndergroundX, gGameUBOptions.MineSectorUndergroundY, gGameUBOptions.MineSectorUndergroundZ );
|
||||
|
||||
// Get index for it...
|
||||
GetTileIndexFromTypeSubIndex( FIRSTDECORATIONS, (INT8)( 5 ), &usTileIndex );
|
||||
|
||||
//Apply changes
|
||||
AddStructToUnLoadedMapTempFile( usGridNo, usTileIndex, 13, MAP_ROW_I, 1 );
|
||||
AddStructToUnLoadedMapTempFile( usGridNo, usTileIndex, gGameUBOptions.MineSectorUndergroundX, gGameUBOptions.MineSectorUndergroundY, gGameUBOptions.MineSectorUndergroundZ );
|
||||
|
||||
|
||||
|
||||
// 2nd half of entrance
|
||||
usGridNo = 12897;
|
||||
usGridNo = gGameUBOptions.MineSectorUndergroundGridno2; //12897;
|
||||
|
||||
// Get index for it...
|
||||
GetTileIndexFromTypeSubIndex( FIRSTDECORATIONS, (INT8)( 2 ), &usTileIndex );
|
||||
|
||||
RemoveStructFromUnLoadedMapTempFile( usGridNo, usTileIndex, 13, MAP_ROW_I, 1 );
|
||||
RemoveStructFromUnLoadedMapTempFile(usGridNo, usTileIndex, gGameUBOptions.MineSectorUndergroundX, gGameUBOptions.MineSectorUndergroundY, gGameUBOptions.MineSectorUndergroundZ);
|
||||
|
||||
// Get index for it...
|
||||
GetTileIndexFromTypeSubIndex( FIRSTDECORATIONS, (INT8)( 6 ), &usTileIndex );
|
||||
|
||||
//Apply changes
|
||||
AddStructToUnLoadedMapTempFile( usGridNo, usTileIndex, 13, MAP_ROW_I, 1 );
|
||||
AddStructToUnLoadedMapTempFile(usGridNo, usTileIndex, gGameUBOptions.MineSectorUndergroundX, gGameUBOptions.MineSectorUndergroundY, gGameUBOptions.MineSectorUndergroundZ);
|
||||
|
||||
//Remove the exit grid
|
||||
AddRemoveExitGridToUnloadedMapTempFile( usGridNo, 13, MAP_ROW_I, 1 );
|
||||
AddRemoveExitGridToUnloadedMapTempFile(usGridNo, gGameUBOptions.MineSectorUndergroundX, gGameUBOptions.MineSectorUndergroundY, gGameUBOptions.MineSectorUndergroundZ);
|
||||
|
||||
// Turn off permenant changes....
|
||||
ApplyMapChangesToMapTempFile( FALSE );
|
||||
|
||||
+44
-11
@@ -303,6 +303,22 @@ UINT32 POWERGENFANSOUND_GRIDNO1 = 10979;
|
||||
UINT32 POWERGENFANSOUND_GRIDNO2 = 19749;
|
||||
UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980;
|
||||
UINT32 STOPPOWERGENFAN_GRIDNO = 10980;
|
||||
//L15-3
|
||||
UINT32 SECTOR_LAUNCH_MISSLES_X = 15;
|
||||
UINT32 SECTOR_LAUNCH_MISSLES_Y = 12;
|
||||
UINT32 SECTOR_LAUNCH_MISSLES_Z = 3;
|
||||
//J13-0
|
||||
UINT32 SECTOR_FAN_X = 13;
|
||||
UINT32 SECTOR_FAN_Z = 10;
|
||||
UINT32 SECTOR_FAN_Y = 0;
|
||||
//K14-1
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1;
|
||||
//J14-1
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1;
|
||||
|
||||
void InitGridNoUB()
|
||||
{
|
||||
@@ -320,6 +336,23 @@ void InitGridNoUB()
|
||||
POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749;
|
||||
STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980;
|
||||
STOPPOWERGENFAN_GRIDNO = gGameUBOptions.StopPowergenFanGridNo; //= 10980;
|
||||
|
||||
//L15-3
|
||||
SECTOR_LAUNCH_MISSLES_X = gGameUBOptions.SectorLaunchMisslesX; // 15;
|
||||
SECTOR_LAUNCH_MISSLES_Y = gGameUBOptions.SectorLaunchMisslesY; // 12;
|
||||
SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3;
|
||||
//J13-0
|
||||
SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13;
|
||||
SECTOR_FAN_Z = gGameUBOptions.SectorFanY; //10;
|
||||
SECTOR_FAN_Y = gGameUBOptions.SectorFanZ; //0;
|
||||
//K14-1
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14;
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11;
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_Z = gGameUBOptions.SectorOpenGateInTunnelZ; //1;
|
||||
//J14-1
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = gGameUBOptions.ExitForFanToPowerGenSectorX; //14;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1;
|
||||
|
||||
MANUEL_UB = gGameUBOptions.ubMANUEL_UB;
|
||||
BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB;
|
||||
@@ -819,8 +852,8 @@ void HandlePowerGenAlarm()
|
||||
static UINT32 uiAlarmCounter=0;
|
||||
UINT32 uiCurTime=0;
|
||||
|
||||
//if its not the right sector
|
||||
if( !( gWorldSectorX == 13 && gWorldSectorY == MAP_ROW_J && gbWorldSectorZ == 0 ) )
|
||||
//if its not the right sector J13-0
|
||||
if( !( gWorldSectorX == SECTOR_FAN_X && gWorldSectorY == SECTOR_FAN_Y && gbWorldSectorZ == SECTOR_FAN_Z ) )
|
||||
{
|
||||
//leave
|
||||
return;
|
||||
@@ -925,9 +958,9 @@ void AddExitGridForFanToPowerGenSector()
|
||||
|
||||
memset( &ExitGrid, 0, sizeof( EXITGRID ) );
|
||||
|
||||
ExitGrid.ubGotoSectorX = 14;
|
||||
ExitGrid.ubGotoSectorY = MAP_ROW_J;
|
||||
ExitGrid.ubGotoSectorZ = 1;
|
||||
ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14;
|
||||
ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J;
|
||||
ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1;
|
||||
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_GRIDNO1;
|
||||
|
||||
//Add the exit grid when the fan is either stopped or blown up
|
||||
@@ -942,8 +975,8 @@ BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSold
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
|
||||
//is this the right sector
|
||||
if( !( gWorldSectorX == 14 && gWorldSectorY == MAP_ROW_K && gbWorldSectorZ == 1 ) )
|
||||
//is this the right sector K14-1
|
||||
if( !( gWorldSectorX == SECTOR_OPEN_GATE_IN_TUNNEL_X && gWorldSectorY == SECTOR_OPEN_GATE_IN_TUNNEL_Y && gbWorldSectorZ == SECTOR_OPEN_GATE_IN_TUNNEL_Z ) )
|
||||
{
|
||||
//wrong door
|
||||
return( FALSE );
|
||||
@@ -1357,8 +1390,8 @@ void HandlePickingUpMorrisInstructionNote( SOLDIERTYPE *pSoldier, INT32 iIndex )
|
||||
|
||||
void HandleDeathInPowerGenSector( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
//if this is NOT the power gen sector
|
||||
if( gWorldSectorX != 13 || gWorldSectorY != 10 || gbWorldSectorZ != 0 )
|
||||
//if this is NOT the power gen sector J13
|
||||
if( gWorldSectorX != SECTOR_FAN_X || gWorldSectorY != SECTOR_FAN_Y || gbWorldSectorZ != SECTOR_FAN_Z )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1777,7 +1810,7 @@ INT8 RandomSoldierIdForAnyMercInSector()
|
||||
void HandleFanStartingAtEndOfCombat()
|
||||
{
|
||||
//if its not the right sector
|
||||
if( !( gWorldSectorX == 13 && gWorldSectorY == MAP_ROW_J && gbWorldSectorZ == 0 ) )
|
||||
if( !( gWorldSectorX == SECTOR_FAN_X && gWorldSectorY == SECTOR_FAN_Y && gbWorldSectorZ == SECTOR_FAN_Z ) )
|
||||
{
|
||||
//leave
|
||||
return;
|
||||
@@ -1945,7 +1978,7 @@ void HandlePlayerHittingSwitchToLaunchMissles()
|
||||
{
|
||||
// if the soldier was in the complex
|
||||
if( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bInSector &&
|
||||
pSoldier->sSectorX == 15 && pSoldier->sSectorY == 12 && pSoldier->bSectorZ == 3 )
|
||||
pSoldier->sSectorX == SECTOR_LAUNCH_MISSLES_X && pSoldier->sSectorY == SECTOR_LAUNCH_MISSLES_Y && pSoldier->bSectorZ == SECTOR_LAUNCH_MISSLES_Z )
|
||||
{
|
||||
if( PythSpacesAway( pSoldier->sGridNo, SWITCHTOLAUNCHMISSLES_GRIDNO1 ) < PythSpacesAway( pSoldier->sGridNo, SWITCHTOLAUNCHMISSLES_GRIDNO2 ) )
|
||||
pSoldier->EVENT_InternalGetNewSoldierPath( SWITCHTOLAUNCHMISSLES_GRIDNO1, RUNNING, TRUE, TRUE );
|
||||
|
||||
@@ -273,6 +273,45 @@ void LoadGameUBOptions()
|
||||
gGameUBOptions.FanGridNo[7] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_8", 10659);
|
||||
gGameUBOptions.FanGridNo[8] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_9", 10660);
|
||||
|
||||
//L15-3
|
||||
gGameUBOptions.SectorLaunchMisslesX = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_LAUNCH_MISSLES_X", 15);
|
||||
gGameUBOptions.SectorLaunchMisslesY = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_LAUNCH_MISSLES_Y", 12);
|
||||
gGameUBOptions.SectorLaunchMisslesZ = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_LAUNCH_MISSLES_Z", 3);
|
||||
|
||||
//J13-0
|
||||
gGameUBOptions.SectorFanX = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_X", 13);
|
||||
gGameUBOptions.SectorFanY = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_Y", 10);
|
||||
gGameUBOptions.SectorFanZ = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_Z", 0);
|
||||
|
||||
//K14-1
|
||||
gGameUBOptions.SectorOpenGateInTunnelX = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_OPEN_GATE_IN_TUNNEL_X", 14);
|
||||
gGameUBOptions.SectorOpenGateInTunnelY = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_OPEN_GATE_IN_TUNNEL_Y", 11);
|
||||
gGameUBOptions.SectorOpenGateInTunnelZ = iniReader.ReadInteger("Unfinished Business Settings","SECTOR_OPEN_GATE_IN_TUNNEL_Z", 1);
|
||||
|
||||
//J14-1
|
||||
gGameUBOptions.ExitForFanToPowerGenSectorX = iniReader.ReadInteger("Unfinished Business Settings","EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X", 14);
|
||||
gGameUBOptions.ExitForFanToPowerGenSectorY = iniReader.ReadInteger("Unfinished Business Settings","EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y", 10);
|
||||
gGameUBOptions.ExitForFanToPowerGenSectorZ = iniReader.ReadInteger("Unfinished Business Settings","EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z", 1);
|
||||
|
||||
|
||||
//I13
|
||||
gGameUBOptions.MineSectorX = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_X", 13);
|
||||
gGameUBOptions.MineSectorY = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_Y", 9);
|
||||
gGameUBOptions.MineSectorZ = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_Z",0);
|
||||
|
||||
gGameUBOptions.MineEntranceGridno = iniReader.ReadInteger("Unfinished Business Settings","MINE_ENTRANCE_GRIDNO",12421);
|
||||
gGameUBOptions.MineGridnoAddStructToHead = iniReader.ReadInteger("Unfinished Business Settings","MINE_GRIDNO_ADD_STRUCT_TO_HEAD",12745);
|
||||
|
||||
gGameUBOptions.MineRemoveExitGridFromWorld1 = iniReader.ReadInteger("Unfinished Business Settings","MINE_REMOVE_EXIT_GRID_FROM_WORLD_1",12422);
|
||||
gGameUBOptions.MineRemoveExitGridFromWorld2 = iniReader.ReadInteger("Unfinished Business Settings","MINE_REMOVE_EXIT_GRID_FROM_WORLD_2",12423);
|
||||
|
||||
gGameUBOptions.MineSectorUndergroundX = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_UNDERGROUND_X", 13);
|
||||
gGameUBOptions.MineSectorUndergroundY = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_UNDERGROUND_Y", 9);
|
||||
gGameUBOptions.MineSectorUndergroundZ = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_UNDERGROUND_Z", 1);
|
||||
|
||||
gGameUBOptions.MineSectorUndergroundGridno1 = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_UNDERGROUND_GRIDNO_1", 13057);
|
||||
gGameUBOptions.MineSectorUndergroundGridno2 = iniReader.ReadInteger("Unfinished Business Settings","MINE_SECTOR_UNDERGROUND_GRIDNO_2", 12897);
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
gGameUBOptions.InGameHeliCrash = FALSE;
|
||||
|
||||
|
||||
+37
@@ -124,6 +124,43 @@ typedef struct
|
||||
UINT32 ubMICRO_UZI_UB;
|
||||
UINT32 ubCALICO_950_UB;
|
||||
UINT32 ubCALICO_900_UB;
|
||||
|
||||
//L15-3
|
||||
UINT32 SectorLaunchMisslesX;
|
||||
UINT32 SectorLaunchMisslesY;
|
||||
UINT32 SectorLaunchMisslesZ;
|
||||
|
||||
//J13-0
|
||||
UINT32 SectorFanX;
|
||||
UINT32 SectorFanY;
|
||||
UINT32 SectorFanZ;
|
||||
|
||||
//K14-1
|
||||
UINT32 SectorOpenGateInTunnelX;
|
||||
UINT32 SectorOpenGateInTunnelY;
|
||||
UINT32 SectorOpenGateInTunnelZ;
|
||||
|
||||
//J14-1
|
||||
UINT32 ExitForFanToPowerGenSectorX;
|
||||
UINT32 ExitForFanToPowerGenSectorY;
|
||||
UINT32 ExitForFanToPowerGenSectorZ;
|
||||
|
||||
UINT32 MineSectorX;
|
||||
UINT32 MineSectorY;
|
||||
UINT32 MineSectorZ;
|
||||
|
||||
UINT32 MineEntranceGridno;
|
||||
UINT32 MineGridnoAddStructToHead;
|
||||
|
||||
UINT32 MineRemoveExitGridFromWorld1;
|
||||
UINT32 MineRemoveExitGridFromWorld2;
|
||||
|
||||
UINT32 MineSectorUndergroundX;
|
||||
UINT32 MineSectorUndergroundY;
|
||||
UINT32 MineSectorUndergroundZ;
|
||||
|
||||
UINT32 MineSectorUndergroundGridno1;
|
||||
UINT32 MineSectorUndergroundGridno2;
|
||||
|
||||
UINT8 MaxNumberOfMercs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user