Figure 11.
There were more special cases, for example when player already holds object. Object held in hands was dropped out automatically and new special object would be held in hands by the system instead.
Lastly, dictionaries needed to be adjusted to reduce or and remove Key completely if ObjectType was the last of it’s specific kind. For example, if Apple_3 amount was 3, and one was taken out, value will be reduced by 1 in the dictionary. If Apple_3 amount was 1 and one such apple was taken out, two dictionaries would remove Apple_3 Key completely.