From 87bd1118d02489066ad42a817b8f547f334ff0bf Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 2 Jun 2018 01:23:59 +0000 Subject: [PATCH] Fix: NPCs with profile > 170 have missing approach values, making it imposssible to fulfil opinion checks Fore more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20659&goto=353657&#msg_353657 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8566 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Profile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index cb3ac2515..2fb29aad0 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -820,6 +820,24 @@ BOOLEAN LoadMercProfiles(void) memset( &gMercProfiles[uiLoop].usDynamicOpinionFlagmask, 0, sizeof(gMercProfiles[uiLoop].usDynamicOpinionFlagmask) ); memset( &gMercProfiles[uiLoop].sDynamicOpinionLongTerm, 0, sizeof(gMercProfiles[uiLoop].sDynamicOpinionLongTerm) ); + + // Flugente: as this data is not in the xml, we set dummy values + if ( gMercProfiles[uiLoop].ubApproachVal[0] == 0 && + gMercProfiles[uiLoop].ubApproachVal[1] == 0 && + gMercProfiles[uiLoop].ubApproachVal[2] == 0 && + gMercProfiles[uiLoop].ubApproachVal[3] == 0 ) + { + for ( int i = 0; i < 4; ++i ) + { + // with ubApproachVal of 50 and ubApproachMod of 100, approach value towards an NPC will be the merc's effective leadership, which seems like a reasonable default + gMercProfiles[uiLoop].ubApproachVal[i] = 50; + + for ( int j = 0; j < 3; ++j ) + { + gMercProfiles[uiLoop].ubApproachMod[j][i] = 100; + } + } + } } // WANNE - BMP: DONE!