Permalink
Browse files

Newtonian Gravity sources inside of a no gravity grav wall zone no lo…

…nger generate gravity
  • Loading branch information...
jacob1 committed Dec 26, 2015
1 parent 5864c36 commit 9a2b7749c7aa57c4732bbde35a70b2aa6f39cfb9
@@ -69,10 +69,13 @@ int Element_GBMB::update(UPDATE_FUNC_ARGS)
}
}
}
if(parts[i].life>20)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 20;
else if(parts[i].life>=1)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = -80;
if (sim->grav->gravmask[(y/CELL)*(XRES/CELL)+(x/CELL)])
{
if (parts[i].life>20)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 20;
else if (parts[i].life>=1)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = -80;
}
return 0;
}
@@ -61,7 +61,8 @@ int Element_GPMP::update(UPDATE_FUNC_ARGS)
if (parts[i].temp<= -256.0+273.15)
parts[i].temp = -256.0+273.15;
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*(parts[i].temp-273.15);
if (sim->grav->gravmask[(y/CELL)*(XRES/CELL)+(x/CELL)])
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*(parts[i].temp-273.15);
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (BOUNDS_CHECK && (rx || ry))
@@ -54,7 +54,8 @@ int Element_GRVT::update(UPDATE_FUNC_ARGS)
if (parts[i].tmp <= -100)
parts[i].tmp = -100;
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*parts[i].tmp;
if (sim->grav->gravmask[(y/CELL)*(XRES/CELL)+(x/CELL)])
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*parts[i].tmp;
return 0;
}
@@ -47,10 +47,13 @@ Element_NBHL::Element_NBHL()
//#TPT-Directive ElementHeader Element_NBHL static int update(UPDATE_FUNC_ARGS)
int Element_NBHL::update(UPDATE_FUNC_ARGS)
{
if (parts[i].tmp)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] += restrict_flt(0.001f*parts[i].tmp, 0.1f, 51.2f);
else
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] += 0.1f;
if (sim->grav->gravmask[(y/CELL)*(XRES/CELL)+(x/CELL)])
{
if (parts[i].tmp)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] += restrict_flt(0.001f*parts[i].tmp, 0.1f, 51.2f);
else
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] += 0.1f;
}
return 0;
}

0 comments on commit 9a2b774

Please sign in to comment.