Delete dangerous items only in safe suns

main
Cameron Murphy Reikes 2 years ago
parent 8ca9f2257e
commit bd41a64b84

@ -2897,6 +2897,8 @@ void process(struct GameState *gs, double dt)
cpVect pos_rel_sun = (cpvsub(entity_pos(e), (entity_pos(i.sun)))); cpVect pos_rel_sun = (cpvsub(entity_pos(e), (entity_pos(i.sun))));
cpFloat sqdist = cpvlengthsq(pos_rel_sun); cpFloat sqdist = cpvlengthsq(pos_rel_sun);
if(i.sun->sun_is_safe)
{
bool is_entity_dangerous = false; bool is_entity_dangerous = false;
is_entity_dangerous |= e->is_missile; is_entity_dangerous |= e->is_missile;
if (e->is_box) if (e->is_box)
@ -2906,7 +2908,7 @@ void process(struct GameState *gs, double dt)
if (is_entity_dangerous && sqdist < sun_dist_no_gravity(i.sun) * sun_dist_no_gravity(i.sun)) if (is_entity_dangerous && sqdist < sun_dist_no_gravity(i.sun) * sun_dist_no_gravity(i.sun))
{ {
e->flag_for_destruction = true; e->flag_for_destruction = true;
break; }
} }
if (!e->is_grid) // grids aren't damaged (this edge case sucks!) if (!e->is_grid) // grids aren't damaged (this edge case sucks!)

Loading…
Cancel
Save