[Fix] Incorrect displaying info and tooltips in Advances Properties Tab

* Tooltips were shifted by one position due to wrong handling "Accuracy modifier".

* DrawAdvancedValues():
    if ( iFloatModifier[0] > 1.0 || ( fComparisonMode && iComparedFloatModifier[0] > 1.0 ) )
it checks number of laser range tiles  (iFloatModifier[0] > 1.0, "meters" / CELL_X_SIZE) right before actual drawing a line with values. So if someone put 1..9 into XML (<BestLaserRange>) it will not print that value. But number of "meters" was checked (like x > 0) everywhere prior to this code.
so all the code before decided to draw line with icon for laser range, but the guilty code line didn't
I suppose not to draw laser info at all if a modder screwed up <BestLaserRange> putting a 1..9 value
so all values 0..9 basically mean 0 tiles, i.e. there is no laser ability.
This commit is contained in:
sun-alf
2023-05-27 21:04:17 +03:00
parent ab2a26accb
commit 9fc9d1c6e8
3 changed files with 49 additions and 46 deletions
+2 -2
View File
@@ -1823,8 +1823,8 @@ void CalculateWeapondata()
pObjUsed = pObjPlatform;
}
gunrange = GunRange( pObjUsed, pSoldier ) / 10;
laserrange = GetBestLaserRange( pObjPlatform ) / 10;
gunrange = GunRange( pObjUsed, pSoldier ) / CELL_X_SIZE;
laserrange = GetBestLaserRange( pObjPlatform ) / CELL_X_SIZE;
if ( Item[pObjUsed->usItem].usItemClass & IC_LAUNCHER )
{