From ee2196ebb4677ce4e5ed5ae799d16b91bda3cbce Mon Sep 17 00:00:00 2001 From: Wanne Date: Thu, 19 Apr 2012 07:46:23 +0000 Subject: [PATCH] - Bugfix: Cap total tunnelvision bonus at 100 to avoid too high values effectively canceling each other (by DepressivesBrot) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5216 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Items.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 00e4be5f..4bbf7bbb 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -10668,10 +10668,10 @@ UINT8 GetPercentTunnelVision( SOLDIERTYPE * pSoldier ) } } - if ( PTR_OURTEAM ) // Madd: adjust tunnel vision by difficulty level - return( bonus ); - else - return bonus / gGameOptions.ubDifficultyLevel; + if ( !PTR_OURTEAM ) // Madd: adjust tunnel vision by difficulty level + bonus /= gGameOptions.ubDifficultyLevel; + + return __min(100, bonus); }