avoid negative values for the rotation variable

This commit is contained in:
owein D 2020-09-30 10:19:10 +02:00
parent c65e3a26fc
commit 490bd3e7cd

2
bfg.c
View file

@ -230,7 +230,7 @@ char *bf_next(_Bool rainy) {
bf_options.rotate += i+3; bf_options.rotate += i+3;
} }
//we don't subtract the same depending on wether the length is odd or even //we don't subtract the same depending on wether the length is odd or even
for(i=1+bf_options.current%2; i<=bf_options.current; ++i) for(i=1+bf_options.current%2; i<bf_options.current+bf_options.current%2; ++i)
bf_options.rotate -= i+1; bf_options.rotate -= i+1;
} }
bf_options.ptr[bf_options.current] = 0; bf_options.ptr[bf_options.current] = 0;