I was struggling to remember/understand this rule of pronoun and indirect and direct order and how it changes depending upon me/te etc or lui/leur etc and came across 'the selfish rule' in a grammar book which helped.
Me first, object second, other people third, then Y and En.
I guess its another was of remembering the rule as given here, "The order is ALWAYS:
me/te/nous/vous (before) le/la/les/l' (before) lui/leur."