From 7163e98b6e79d9e65274f2a7bec19a1e14691faa Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 14 Jan 2017 22:22:30 +0000 Subject: [PATCH] Mercs won't attack teammates or neutrals (profile-based) if their opinion of them is > 20. For good guys, that value is -20. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8365 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle Items.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 1ccb3538a..1e948e39a 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -77,6 +77,7 @@ #include "LaptopSave.h" // added by Flugente #include "Game Clock.h" // added by Flugente #include // added by Flugente for vfs-stuff + #include "DynamicDialogue.h" // added by Flugente for SoldierRelation() #endif #ifdef JA2UB @@ -311,13 +312,17 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa TacticalCharacterDialogue( pSoldier, QUOTE_REFUSING_ORDER ); return( ITEM_HANDLE_REFUSAL ); } + if ( pTargetSoldier->ubProfile != NO_PROFILE ) { + // Flugente: as relations are now dynamic, check that instead // buddies won't shoot each other - if ( WhichBuddy( pSoldier->ubProfile, pTargetSoldier->ubProfile ) != -1 ) + INT8 bOpinion = SoldierRelation( pSoldier, pTargetSoldier ); + + if ( bOpinion > BUDDY_OPINION - 5 || ((gMercProfiles[pSoldier->ubProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_GOODGUY) && bOpinion > HATED_OPINION + 5) ) { TacticalCharacterDialogue( pSoldier, QUOTE_REFUSING_ORDER ); - return( ITEM_HANDLE_REFUSAL ); + return(ITEM_HANDLE_REFUSAL); } }