When playing multiple consecutive races causes the cars to be incorrectly ordered on the **cars array (global variable in helpers/game.c) therefore, causing them to be rendered in an incorrect order and also affecting things like placements.
Running a few tests i could realize that the cars array stays ordered like it has been at the end of the first race placed, which should not happen since the array goes through a quick sort each time the game is updated. To avoid this i started cleaning the cars array at the end of each race (on void clear_game() at helpers/game.c line 717) and refilling it at each race start (on void setup() at helpers/game.c lines 583 and 589) but it does not seem to be of any help.
When playing multiple consecutive races causes the cars to be incorrectly ordered on the **cars array (global variable in helpers/game.c) therefore, causing them to be rendered in an incorrect order and also affecting things like placements. Running a few tests i could realize that the cars array stays ordered like it has been at the end of the first race placed, which should not happen since the array goes through a quick sort each time the game is updated. To avoid this i started cleaning the cars array at the end of each race (on
void clear_game()
at helpers/game.c line 717) and refilling it at each race start (onvoid setup()
at helpers/game.c lines 583 and 589) but it does not seem to be of any help.