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:
Overhaul
2007-08-01 08:58:34 +00:00
parent 99358cf103
commit b07d18f9f4
15 changed files with 123 additions and 133 deletions
+8
View File
@@ -679,6 +679,14 @@ void RenderMapEntryPointsAndLights()
{
if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE )
{
// Check for light out of bounds. This actually happens in Drassen.
if (LightSprites[ i ].iY < 0 || LightSprites[ i ].iY > WORLD_ROWS ||
LightSprites[ i ].iX < 0 || LightSprites[ i ].iX > WORLD_COLS)
{
LightSprites[ i ].uiFlags &= (~LIGHT_SPR_ACTIVE);
continue;
}
sGridNo = LightSprites[ i ].iY * WORLD_COLS + LightSprites[ i ].iX;
GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
if( sScreenY >= (- 50) && sScreenY < (2 * iScreenHeightOffset + 300) && sScreenX >= (- 40) && sScreenX < SCREEN_WIDTH )
+2 -1
View File
@@ -591,6 +591,8 @@ BOOLEAN ExecuteUndoList( void )
{
iUndoMapIndex = gpTileUndoStack->pData->iMapIndex;
fExitGrid = ExitGridAtGridNo( (UINT16)iUndoMapIndex );
// Find which map tile we are to "undo"
if( gpTileUndoStack->pData->fLightSaved )
{ //We saved a light, so delete that light
@@ -609,7 +611,6 @@ BOOLEAN ExecuteUndoList( void )
else
{ // We execute the undo command node by simply swapping the contents
// of the undo's MAP_ELEMENT with the world's element.
fExitGrid = ExitGridAtGridNo( (UINT16)iUndoMapIndex );
SwapMapElementWithWorld( iUndoMapIndex, gpTileUndoStack->pData->pMapTile );
// copy the room number information back
+1 -1
View File
@@ -803,7 +803,7 @@ void ShowCurrentDrawingMode( void )
NewRect.iLeft = iScreenWidthOffset + 0;
NewRect.iTop = 2 * iScreenHeightOffset + 400;
NewRect.iRight = iScreenWidthOffset + 100;
NewRect.iBottom = 2 * iScreenWidthOffset + 458;
NewRect.iBottom = 2 * iScreenHeightOffset + 458;
GetClippingRect(&ClipRect);
SetClippingRect(&NewRect);