From edf1aaa302980bd46f2ee6c20d0767cf9cf98dfd Mon Sep 17 00:00:00 2001 From: ChrisL Date: Tue, 21 Jun 2011 16:46:35 +0000 Subject: [PATCH] BUGFIX 538 - Added a condition so that if a door is not openable, iChance will be reset to 0 in time for the merc to make the "this is impossible" speech. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4517 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/SkillCheck.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tactical/SkillCheck.cpp b/Tactical/SkillCheck.cpp index bbe132d8..6ae737e0 100644 --- a/Tactical/SkillCheck.cpp +++ b/Tactical/SkillCheck.cpp @@ -553,8 +553,6 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) iSkill -= GetSkillCheckPenaltyForFatigue( pSoldier, iSkill ); - iChance = iSkill + bChanceMod; - //////////////////////////////////////////////////////////////////////// // SANDRO - STOMP - character traits and disabilities modifiers @@ -634,6 +632,13 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) } ////////////////////////////////////////////////////////////////////// + // CHRISL: If lock is flagged OPENING_NOT_POSSIBLE, then reset iChance to 0 regardless of mercs skills. Also, moved this check to after personality and + // disability checks since an unopenable door isn't going to suddenly be openable just cause we have some other bonus. + if(bChanceMod != -100) + iChance = iSkill + bChanceMod; + else + iChance = 0; + // silversurfer: moved this down here where it belongs // if this wasn't the last check a merc with certain disability modifiers would never completely fail // to do something and would never do his speech telling that he can't do this