GetSightAdjustmentCamouflageOnTerrain: fix signed/unsigned calculation, limit effectiveness to +-100.

GetDetailedSightAdjustmentCamouflageOnTerrain: fix signed/unsigned calculation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9194 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-10-24 15:02:27 +00:00
parent 36d67602fd
commit 4b646aad96
+5 -6
View File
@@ -632,15 +632,16 @@ INT8 GetSightAdjustmentCamouflageOnTerrain( SOLDIERTYPE* pSoldier, const UINT8&
INT16 scaler = -(ANIM_STAND+1 - ubStance); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
UINT8 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness;
effectiveness += (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CAMO));
INT16 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness + pSoldier->GetBackgroundValue(BG_PERC_CAMO);
if (ProfileHasSkillTrait(pSoldier->ubProfile, SURVIVAL_NT))
{
effectiveness += gSkillTraitValues.ubSVCamoEffectivenessBonus;
}
effectiveness = min(100, effectiveness);
effectiveness = max(-100, effectiveness);
scaler = effectiveness * scaler / 6;
switch(ubTerrainType) {
@@ -675,9 +676,7 @@ INT8 GetDetailedSightAdjustmentCamouflageOnTerrain( SOLDIERTYPE* pSoldier, const
INT16 scaler = -(ANIM_STAND+1 - max(ANIM_PRONE, ubStance - bStanceModifier)); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
UINT8 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness;
effectiveness += (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CAMO));
INT16 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness + pSoldier->GetBackgroundValue(BG_PERC_CAMO);
if (ProfileHasSkillTrait(pSoldier->ubProfile, SURVIVAL_NT))
{