scoreboard players add @s generic_timer 1

tp @s ^ ^ ^0.9 ~ ~1
particle smoke ~ ~ ~ 0.1 0.1 0.1 0.01 25 force @a

execute if entity @s[tag=blue] positioned ~ ~-1 ~ if entity @a[team=red,distance=..1,gamemode=!spectator] run function pctf:logic/items/smoke_bomb/detonate
execute if entity @s[tag=red] positioned ~ ~-1 ~ if entity @a[team=blue,distance=..1,gamemode=!spectator] run function pctf:logic/items/smoke_bomb/detonate

execute unless block ~ ~ ~ #pctf:projectile_pass run function pctf:logic/items/smoke_bomb/detonate

execute if score @s generic_timer matches 40.. run function pctf:logic/items/smoke_bomb/detonate