mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Fix: crash when clicking on empty inventory slot
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8459 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+4
-2
@@ -1546,8 +1546,10 @@ void ResizeBoxToText(INT32 hBoxHandle)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PopUpBoxList[hBoxHandle]->Dimensions.iBottom=iHeight;
|
|
||||||
PopUpBoxList[hBoxHandle]->Dimensions.iRight=iWidth;
|
// Flugente we shouldn't have added more popup options than we can display anyway, but I have no idea where to stop that, so at least we can fix this
|
||||||
|
PopUpBoxList[hBoxHandle]->Dimensions.iBottom = min( iHeight, SCREEN_HEIGHT - PopUpBoxList[hBoxHandle]->Position.iY);
|
||||||
|
PopUpBoxList[hBoxHandle]->Dimensions.iRight = min( iWidth, SCREEN_WIDTH - PopUpBoxList[hBoxHandle]->Position.iX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1646,6 +1646,13 @@ void POPUP::DetermineBoxPositions( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Flugente: fix obvious errors
|
||||||
|
pPoint.iX = max( pPoint.iX, 0 );
|
||||||
|
pPoint.iX = min( pPoint.iX, SCREEN_WIDTH );
|
||||||
|
|
||||||
|
pPoint.iY = max( pPoint.iY, 0 );
|
||||||
|
pPoint.iY = min( pPoint.iY, SCREEN_HEIGHT );
|
||||||
|
|
||||||
// set all the other positions to match this one
|
// set all the other positions to match this one
|
||||||
this->Position = pPoint;
|
this->Position = pPoint;
|
||||||
this->BoxesX = pPoint.iX;
|
this->BoxesX = pPoint.iX;
|
||||||
|
|||||||
Reference in New Issue
Block a user