mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
+4
-1
@@ -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]];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user