fixed handling of player with no inventory
Merge remote-tracking branch 'upstream/separate-item-rep'
Merged upstream changes.