I'm working on Genki II and I came across this sentence in a drill.
友だちが病気だったらくすりを買ってきてあげます。
I get about 90% of what is happening here. It's an if/then statement where if my friend is sick, I will buy medicine for them.
I get the てあげる ending without any trouble, but きて is throwing me for a loop. Is this a te following a te form? If so should I be reading this as くる in te form e.g. I will come and buy medicine for them?