mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- Added rooftop CtH fix from AndroidXP
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@812 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -568,9 +568,15 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos, BOOLE
|
||||
|
||||
if(pSoldier->bDoAutofire == 0 && gGameSettings.fOptions[ TOPTION_CTH_CURSOR ])
|
||||
{
|
||||
//AXP 29.03.2007: Rooftop CtH fix. See below.
|
||||
INT8 bTempTargetLevel = pSoldier->bTargetLevel;
|
||||
pSoldier->bTargetLevel = gsInterfaceLevel;
|
||||
|
||||
UINT32 uiHitChance;
|
||||
uiHitChance = CalcChanceToHitGun( pSoldier, usMapPos, 0, pSoldier->bAimShotLocation );
|
||||
|
||||
pSoldier->bTargetLevel = bTempTargetLevel;
|
||||
|
||||
gfUICtHBar = TRUE;
|
||||
gbCtH = (gbCtH+uiHitChance)/2;
|
||||
}
|
||||
@@ -581,9 +587,16 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos, BOOLE
|
||||
//DIGICRAB: Graphical CtH
|
||||
if(gGameSettings.fOptions[ TOPTION_CTH_CURSOR ])
|
||||
{
|
||||
//AXP 29.03.2007: Rooftop CtH fix. Temporarily set soldier targetlevel to the real interface
|
||||
//level (selected with TAB), so the first shot after switching TL is calculated correctly
|
||||
INT8 bTempTargetLevel = pSoldier->bTargetLevel;
|
||||
pSoldier->bTargetLevel = gsInterfaceLevel;
|
||||
|
||||
UINT32 uiHitChance;
|
||||
uiHitChance = CalcChanceToHitGun( pSoldier, usMapPos, (INT8)(pSoldier->bShownAimTime ), pSoldier->bAimShotLocation );
|
||||
|
||||
pSoldier->bTargetLevel = bTempTargetLevel;
|
||||
|
||||
gfUICtHBar = TRUE;
|
||||
gbCtH = (gbCtH+uiHitChance)/2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user