Vasubandhu's Abhidharmakośabhāṣya characterises Buddhist ethics as strongly intentional. It does not matter what you do, it is the intention beyond the act which is the action (and, hence, causes further results). If one offers alms because one wants to be thanked, one will not get any moral reward for it. This shift of perspective might be historically explained as due to the desire to differentiate the Buddhist ethics from the Jaina (and from some common-stream Indian) one. Still, there are mighty difficulties implied in it. I will hint at them in the next posts, but let me now mention a possible problem and its solution, as found in the chapter dedicated to action.
One is not accusable of adultery, it is said, if one unwillingly touches someone's else wife. Of course, one were accusable, if one had decided to touch her, however (seemingly) incidentally. But to touch one unwillingly could be thought of as a lack of attention (smṛti). Why is this not censured? Maybe because it is a symptom of the fact that one is still not a Bodhisattva, but it is not in itself an action. Of the action, it lacks the intentional character. It has not been planned, willed. Hence, it bears no fruit. Similarly, Janet Gyatso discusses the case of pollutions in dreams within monastic code (Vinaya). Even in this case, the offence is only a minor one because (if my interpretation is correct) the dream shows that one's mind is still polluted but is not the result of an act of one's willpower.