Revert "Revert "Fix "Client: Don't crash if trying to draw too many items from inventory in HUD"""

This reverts commit 9b5fd0c3911936fa9dfa4bc35ce773a37ff31709.