I understand the general ruling on companions lost on death. Essentially it says "whomever enters the room first gains custody of the companion". However, this doesn't quite make sense for the scenario I'm in right now: two heros and the traitor are in a room. One hero has the madman, and dies fighting the traitor. Now the madman, last hero and traitor are all in the same room. Who gets the madman? We eventually decided that you had to move out of the room and back into the room to take the madman, since that's what the rules seem to say, but that seems illogical.
Tl;dr if a companion is in the same room as two explorers, who gets the companion?