Case:
- Command to Hero 1: Give item to Hero 2 (which currently has full inventory with no free slots).
- Select Hero 2 — drop/sell something to free up a slot. Done, now there is 1 free slot.
- Hero 1 comes to Hero 2 and drops item to the ground.
So, algorithm makes a decision “transfer or drop” on command stage, not when Hero 1 contacts Hero 2. (Same for Units with backpack)