Protect code for adding cards to player's inventory from high indexes