MakeSureMedKitIsInHand:

- for AI, just swap objects as they don't care about pockets
- only show "nowhere to place item" message for player mercs (prevents medic AI from spamming messages)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9394 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2022-08-06 12:44:56 +00:00
parent f733bda830
commit 07700a8d7e
+8 -2
View File
@@ -10508,8 +10508,14 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
fCharacterInfoPanelDirty = TRUE;
//shadooow: rules for item swapping rewritten to honor pocket restrictions
// sevenfm: for AI, just swap objects
if (!(pSoldier->flags.uiStatusFlags & SOLDIER_PC))
{
SwapObjs(pSoldier, HANDPOS, bPocket, TRUE);
return(TRUE);
}
//nothing in main hand
if (!pSoldier->inv[HANDPOS].exists())
else if (!pSoldier->inv[HANDPOS].exists())
{
SwapObjs(pSoldier, HANDPOS, bPocket, TRUE);//todo: this should probably be more robust and handle potentional custom medical kit that uses both hands
return(TRUE);
@@ -10557,7 +10563,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
}
}
//if we came here it means we don't have medical kit or we cannot place it into hand due to no suitable pockets for whatever merc carries in them
if(medkit_found)
if (medkit_found && (pSoldier->flags.uiStatusFlags & SOLDIER_PC))
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[QUICK_ITEMS_NOWHERE_TO_PLACE]);
if(!bAllow1stAidKit)
return FALSE;