I don't know why it wouldn't work, maybe because of some machine number inaccuracies, but this should do the trick:

while(1)
{
gv_dist += time_step;
if(gv_dist >= 22.6)
{
gv_dist = 22.6;
break;
}
wait(1);
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends