A lot of room for not knowing all the details, but reports are the shooter pointed the rifle at the cop who was likely only armed with a pistol if his hands were free to hold a weapon at all (generally speaking at any significant distance, in rifle against pistol, rifle wins)... and even though the cop retreated (i can not blame him if a rifle was pointed at him, and from other reports he was climbing up with his hands on the roof and dropped down when the rifle was pointed at him) it was reported that when the cop retreated is when the shooter began shooting... it may be had the cop not confronted him, the shooter would have made a more careful and effective shot.
We may learn more, but the cop may have just reacted instictively to having a rifle pointed at him, but may have shaken the shooter enough to rush and be less acurate than he would have otherwise have been.
“...who was likely only armed with a pistol..”
Uhh, a pistol would work.