Fix for militia transported to NOWHERE during autoresolve in a different than current sector

INS for overhead map is back!
Weapon CTH at extreme range now calculated with soldier's real sight max


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1237 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-08-21 07:51:09 +00:00
parent f4bbb51e07
commit c01ba3f6f1
5 changed files with 13 additions and 7 deletions
+4 -1
View File
@@ -2383,7 +2383,10 @@ SOLDIERTYPE* TacticalCreateMilitia( UINT8 ubMilitiaClass )
UINT8 ubID;
SOLDIERTYPE * pSoldier;
if( guiCurrentScreen == AUTORESOLVE_SCREEN && !gfPersistantPBI )
if (gpBattleGroup->ubSectorZ == gbWorldSectorZ &&
gpBattleGroup->ubSectorX == gWorldSectorX &&
gpBattleGroup->ubSectorY == gWorldSectorY &&
guiCurrentScreen == AUTORESOLVE_SCREEN && !gfPersistantPBI )
{
pSoldier = ReserveTacticalMilitiaSoldierForAutoresolve( ubMilitiaClass );
if( pSoldier ) return pSoldier;
+1 -1
View File
@@ -2834,7 +2834,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
// WANNE: Commented this out, because the interface panel is not correctly redrawn!
// I do not know the bug ;(
//GoIntoOverheadMap();
GoIntoOverheadMap();
break;
// Lalien: commented out, to fix "end move & LOS bug" (same button has two different actions)
+5 -3
View File
@@ -3649,7 +3649,8 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
iChance -= iPenalty;
}
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0, pSoldier );
// 0verhaul: Changed to take expanded range from shooting at different levels into account
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pSoldier->bTargetLevel, pSoldier );
// give some leeway to allow people to spot for each other...
// use distance limitation for LOS routine of 2 x maximum distance EVER visible, so that we get accurate
@@ -3664,14 +3665,15 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
ubTargetID = WhoIsThere2( sGridNo, pSoldier->bTargetLevel );
// best to use team knowledge as well, in case of spotting for someone else
// 0verhaul: Why not use the distance visible as the max for line of sight testing?
if (ubTargetID != NOBODY && pSoldier->bOppList[ubTargetID] == SEEN_CURRENTLY || gbPublicOpplist[pSoldier->bTeam][ubTargetID] == SEEN_CURRENTLY)
{
iSightRange = SoldierToBodyPartLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bAimShotLocation, (UINT8) (MaxDistanceVisible() * 2), TRUE );
iSightRange = SoldierToBodyPartLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bAimShotLocation, (UINT8) sDistVis /*(MaxDistanceVisible() * 2) */, TRUE );
}
if (iSightRange == -1) // didn't do a bodypart-based test
{
iSightRange = SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bTargetCubeLevel, (UINT8) (MaxDistanceVisible() * 2), TRUE );
iSightRange = SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bTargetCubeLevel, (UINT8) sDistVis /* (MaxDistanceVisible() * 2) */, TRUE );
}
iSightRange *= 2;
+1 -1
View File
@@ -1209,7 +1209,7 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
//if ( pSubject && !( pSubject->fMuzzleFlash && (bLightLevel > NORMAL_LIGHTLEVEL_DAY) ) )
if ( !( pSubject && pSubject->fMuzzleFlash && (bLightLevel > NORMAL_LIGHTLEVEL_DAY) ) )
{
// ATE: Made function to adjust light distence...
// ATE: Made function to adjust light distance...
sDistVisible = AdjustMaxSightRangeForEnvEffects( pSoldier, bLightLevel, sDistVisible );
}
+2 -1
View File
@@ -630,7 +630,7 @@ void GoIntoOverheadMap( )
DisableTacticalTeamPanelButtons( TRUE );
}
EmptyBackgroundRects( );
EmptyBackgroundRects( );
}
}
@@ -760,6 +760,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
//ColorFillVideoSurfaceArea( FRAME_BUFFER, sStartPointX_S, sStartPointY_S, sEndXS, sEndYS, 0 );
ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0 );
fInterfacePanelDirty = DIRTYLEVEL2;
InvalidateScreen( );
gfOverheadMapDirty = FALSE;