Similar test to #255 but explicitly runs the interaction between food and player
//#define FIX_ISSUE_394
#ifdef FIX_ISSUE_394
{
game g;
player p = g.get_player(0);
food f = g.get_food()[0];
int f_regen_time = f.get_regeneration_time();
// Player on top of food should eat it
assert(!nth_food_is_eaten(g, 0));
put_player_on_food(p, f);
g.tick();
assert(nth_food_is_eaten(g, 0));
// Get player away so it does not eat food again
put_player_near_food(p, f, f.get_radius() * 2.0);
// Food item should not regen before the regeneration time
for(int i = 0; i != f_regen_time - 1; i++)
{
g.tick();
}
assert(nth_food_is_eaten(g,0));
g.tick();
// Food item should regen on the regeneration time
assert(!nth_food_is_eaten(g,0));
}
#endif
Similar test to #255 but explicitly runs the interaction between food and player