The smoke repels mosquitoes, but the increased CO2 attracts mosquitoes: it is their long range detector of mammal prey (up to 50 meter).
IIRC the agressive African honeybee was the first charted in this respect. They follow the CO2 trail and attack. Running away while holding your breath to make enough distance is there your escape.
The amount of CO2 from a cigarette about the same as what you normally breath out in rest: you double the output CO2.
so in effect: if you smoke it hurts the ones sitting next to you that do not smoke