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
This commit is contained in:
Flugente
2017-01-14 22:22:30 +00:00
parent efd9ab4723
commit 7163e98b6e
+7 -2
View File
@@ -77,6 +77,7 @@
#include "LaptopSave.h" // added by Flugente
#include "Game Clock.h" // added by Flugente
#include <vfs/Core/vfs_file_raii.h> // 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);
}
}