|
|
@ -2492,7 +2492,10 @@ void process(struct GameState *gs, double dt, bool is_subframe)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
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 (!e->is_grid) // grids aren't damaged (this edge case sucks!)
|
|
|
|
if (!e->is_grid) // grids aren't damaged (this edge case sucks!)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PROFILE_SCOPE("Grid processing")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sqdist = cpvlengthsq(cpvsub((entity_pos(e)), (entity_pos(i.sun))));
|
|
|
|
sqdist = cpvlengthsq(cpvsub((entity_pos(e)), (entity_pos(i.sun))));
|
|
|
|
if (sqdist < (i.sun->sun_radius * i.sun->sun_radius))
|
|
|
|
if (sqdist < (i.sun->sun_radius * i.sun->sun_radius))
|
|
|
@ -2500,8 +2503,11 @@ void process(struct GameState *gs, double dt, bool is_subframe)
|
|
|
|
e->damage += 10.0 * dt;
|
|
|
|
e->damage += 10.0 * dt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (e->body != NULL)
|
|
|
|
if (e->body != NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PROFILE_SCOPE("Body processing")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cpVect accel = sun_gravity_accel_for_entity(e, i.sun);
|
|
|
|
cpVect accel = sun_gravity_accel_for_entity(e, i.sun);
|
|
|
|
cpVect new_vel = entity_vel(gs, e);
|
|
|
|
cpVect new_vel = entity_vel(gs, e);
|
|
|
@ -2510,6 +2516,7 @@ void process(struct GameState *gs, double dt, bool is_subframe)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (e->is_explosion)
|
|
|
|
if (e->is_explosion)
|
|
|
|
{
|
|
|
|
{
|
|
|
|