mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Editor: Disable light sprites that are not in bounds. Actually happens in some sectors (ie Drassen)
Editor: Fix for use of uninitialized variable in undo Editor: Fix for clipping bounds that are offscreen (causes crash) Fix for AP bonus reading from INI Fix mine indexes when looking for creature infestation of mines Final (?) fix for militia reinforcements. Also a change: If you refuse reinforcements, none will come for the entirety of the battle Increase size of cover and LOS grids to fit max radius Fix for uninitialized light level in DistanceVisible Move CheckForEndOfBattle to end of ReduceAttackBusy, to remove a possible militia invalidate upon promotion Change the way Alt-L handles reloading git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1142 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -35,8 +35,8 @@
|
||||
//******* Local Defines **************************************************
|
||||
|
||||
|
||||
#define DC_MAX_COVER_RANGE 42 //31
|
||||
#define DC__SOLDIER_VISIBLE_RANGE 42 //31
|
||||
#define DC_MAX_COVER_RANGE 43 //31
|
||||
#define DC__SOLDIER_VISIBLE_RANGE 43 //31
|
||||
|
||||
#define DC__MIN_SIZE 4
|
||||
#define DC__MAX_SIZE 21 //11
|
||||
@@ -338,15 +338,15 @@ void CalculateCoverInRadiusAroundGridno( INT16 sTargetGridNo, INT8 bSearchRange
|
||||
|
||||
pSoldier = GetCurrentMercForDisplayCover();
|
||||
|
||||
sCounterX = sCounterY = 0;
|
||||
// sCounterX = sCounterY = 0;
|
||||
|
||||
//Determine the stance to use
|
||||
bStance = GetCurrentMercForDisplayCoverStance();
|
||||
|
||||
//loop through all the gridnos that we are interested in
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
for (sCounterY = 0, sCounterX = 0, sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++, sCounterY++, sCounterX = 0)
|
||||
{
|
||||
for (sXOffset = -sMaxLeft; sXOffset <= sMaxRight; sXOffset++)
|
||||
for (sXOffset = -sMaxLeft; sXOffset <= sMaxRight; sXOffset++, sCounterX++)
|
||||
{
|
||||
sGridNo = sTargetGridNo + sXOffset + (MAXCOL * sYOffset);
|
||||
|
||||
@@ -381,7 +381,7 @@ void CalculateCoverInRadiusAroundGridno( INT16 sTargetGridNo, INT8 bSearchRange
|
||||
if ( !(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE) )
|
||||
{
|
||||
//skip to the next gridno
|
||||
sCounterX++;
|
||||
// sCounterX++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -403,10 +403,10 @@ void CalculateCoverInRadiusAroundGridno( INT16 sTargetGridNo, INT8 bSearchRange
|
||||
// gCoverRadius[ sCounterX ][ sCounterY ].fRoof = fRoof;
|
||||
|
||||
|
||||
sCounterX++;
|
||||
// sCounterX++;
|
||||
}
|
||||
sCounterY++;
|
||||
sCounterX = 0;
|
||||
// sCounterY++;
|
||||
// sCounterX = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ void RemoveMilitiaFromTactical()
|
||||
}
|
||||
}
|
||||
|
||||
void PrepareMilitiaForTactical()
|
||||
void PrepareMilitiaForTactical( BOOLEAN fPrepareAll)
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
INT32 x;
|
||||
@@ -227,10 +227,14 @@ void PrepareMilitiaForTactical()
|
||||
ubRegs = pSector->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
|
||||
ubElites = pSector->ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
|
||||
|
||||
#if 0
|
||||
if(guiDirNumber)
|
||||
{
|
||||
for( x = 0 ; x < guiDirNumber ; ++x )
|
||||
if (fPrepareAll)
|
||||
{
|
||||
AddSoldierInitListMilitia( gpAttackDirs[ 0 ][0], gpAttackDirs[ 0 ][1], gpAttackDirs[ 0 ][2] );
|
||||
}
|
||||
// If the sector is already loaded, don't add the existing militia
|
||||
for( x = 1; x < guiDirNumber ; ++x )
|
||||
{
|
||||
#if 0
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld,%ld,%ld", gpAttackDirs[ x ][ 0 ], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2], gpAttackDirs[ x ][3] );
|
||||
@@ -247,19 +251,12 @@ void PrepareMilitiaForTactical()
|
||||
else
|
||||
{
|
||||
#endif
|
||||
if( gpAttackDirs[ x ][ 3 ] == INSERTION_CODE_CENTER )
|
||||
{
|
||||
AddSoldierInitListMilitia( gpAttackDirs[ x ][0], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2] );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSoldierInitListMilitiaOnEdge( gpAttackDirs[ x ][ 3 ], gpAttackDirs[ x ][0], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2] );
|
||||
}
|
||||
// }
|
||||
AddSoldierInitListMilitiaOnEdge( gpAttackDirs[ x ][ 3 ], gpAttackDirs[ x ][0], gpAttackDirs[ x ][1], gpAttackDirs[ x ][2] );
|
||||
}
|
||||
|
||||
guiDirNumber = 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
else if (fPrepareAll)
|
||||
{
|
||||
AddSoldierInitListMilitia( ubGreen, ubRegs, ubElites );
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "mousesystem.h"
|
||||
#include "Strategic Movement.h"
|
||||
|
||||
void PrepareMilitiaForTactical();
|
||||
void PrepareMilitiaForTactical(BOOLEAN fPrepareAll);
|
||||
void RemoveMilitiaFromTactical();
|
||||
void ResetMilitia();
|
||||
void HandleMilitiaPromotions();
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#define NOHIDE_REDUNDENCY 0x000010000
|
||||
#define DEBUGCLIFFS 0x000020000
|
||||
#define INCOMBAT 0x000040000
|
||||
#define WANT_MILITIA_REINFORCEMENTS 0x000080000
|
||||
#define ACTIVE 0x000100000
|
||||
#define SHOW_Z_BUFFER 0x000200000
|
||||
#define SLOW_ANIMATION 0x000400000
|
||||
|
||||
@@ -6255,7 +6255,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
}
|
||||
|
||||
HandleMilitiaStatusInCurrentMapBeforeLoadingNewMap();
|
||||
gfStrategicMilitiaChangesMade = TRUE;
|
||||
//gfStrategicMilitiaChangesMade = TRUE;
|
||||
|
||||
|
||||
// Loop through all militia and restore them to peaceful status
|
||||
@@ -7677,8 +7677,6 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
|
||||
|
||||
DequeueAllDemandGameEvents( TRUE );
|
||||
|
||||
CheckForEndOfBattle( FALSE );
|
||||
|
||||
// if we're in realtime, turn off the attacker's muzzle flash at this point
|
||||
if ( !(gTacticalStatus.uiFlags & INCOMBAT) && pSoldier )
|
||||
{
|
||||
@@ -7738,6 +7736,8 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
|
||||
}
|
||||
}
|
||||
|
||||
CheckForEndOfBattle( FALSE );
|
||||
|
||||
return( pTarget );
|
||||
}
|
||||
|
||||
|
||||
@@ -1534,7 +1534,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
LeaveTacticalScreen( GAME_SCREEN );
|
||||
gfSaveGame = FALSE;
|
||||
gfCameDirectlyFromGame = TRUE;
|
||||
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||
DoQuickLoad();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1196,6 +1196,8 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("113/UC Warning! Tried to detect the light level when character %ls[%d] looks at a location outside of the valid map (gridno %d). Assigning default %d",
|
||||
pSoldier->name, pSoldier->ubID, pSoldier->sGridNo, ubAmbientLightLevel));
|
||||
}
|
||||
|
||||
bLightLevel = ubAmbientLightLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user