Sleeping with my friends ex???

So my best friend, lets call him D, started fooling around w me. And vice versa. We’re just friends, but we’ve slept together 3 times now and both have given each other oral multiple times. The only thing, is he’s my other friends ex. And hes still in love with her although she has no feelings for him at all even after dating him for a year. I just need advice. I don’t know what to do.