There was a bug before where the thread would not close properly when the pet died from the stats decreasing below the minimum threshold. This is caused by the fact that the thread is responsible for detecting this, and thus calls the join() function, which then leads to an error.
Instead, the thread stops when the the is_alive state is False, and the choose_action() also responds to this and lead the game manager to the shut_down() method.
Note that the former die() function is now the end() function since this function is also called when the pet is transferred.
There was a bug before where the thread would not close properly when the pet died from the stats decreasing below the minimum threshold. This is caused by the fact that the thread is responsible for detecting this, and thus calls the join() function, which then leads to an error.
Instead, the thread stops when the the is_alive state is False, and the choose_action() also responds to this and lead the game manager to the shut_down() method.
Note that the former die() function is now the end() function since this function is also called when the pet is transferred.