If placing an item fails due to invalid item size, at least inform the player before crashing the game on purpose

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8436 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-07-31 17:46:50 +00:00
parent 41056de164
commit a7bb8b9fe9
+4 -1
View File
@@ -6405,7 +6405,10 @@ INT32 PickPocket(SOLDIERTYPE *pSoldier, UINT8 ppStart, UINT8 ppStop, UINT16 usIt
INT32 pocket=0;
UINT8 capacity=254;
for(UINT32 uiPos=ppStart; uiPos<ppStop; uiPos++){
// Flugente: if we're going to fail miserably, at least tell us why
AssertMsg( Item[usItem].ItemSize < gGameExternalOptions.guiMaxItemSize + 1, String( "Size of item %d (%d) exceeds max item size (%d)!", usItem, Item[usItem].ItemSize, gGameExternalOptions.guiMaxItemSize + 1 ) );
for(UINT32 uiPos=ppStart; uiPos<ppStop; ++uiPos){
if(pSoldier->inv[icLBE[uiPos]].exists() == false){
pIndex=LoadBearingEquipment[Item[icDefault[uiPos]].ubClassIndex].lbePocketIndex[icPocket[uiPos]];
}