The Basis of Morality by Part 3 Chapter 5 Page 7

operative, when a man, following Wolff's principles, seeks by his conduct to work out his own perfection. In short, one may make the ultimate incentive to an action what one pleases; it will always turn out, no matter by how circuitous a path, that in the last resort what affects the actual weal and woe of the agent himself is the real motive; consequently what he does is egoistic, and therefore without moral worth.

There is only a single case in which this fails to happen: namely, when the ultimate incentive for doing something, or leaving it undone, is precisely and exclusively centred in the weal and woe of some one else, who plays a passive part; that is to say, when the person on the active side, by what he does, or omits to do, simply and solely regards the weal and woe of another, and has absolutely no other object