jacksonmj/The-Powder-Toy — comment on commit 2b12fa3af632b4dca3045ace02676de3604e007a
File: src/main.c line 1868
By jacksonmj:

Oops, forgot about that. gravity_update_async is probably a better place for it, so these lines need removing.

However, in gravity_update_async, I think the gravmap also needs clearing when Newtonian gravity is disabled. When I turn N-grav on and off a couple of times after removing these lines, there is sometimes a very large gravity field in the first frame after turning it on. Steps to reproduce:
Place some BHOL. Decrease the FPS cap (to something low, like 5). Turn Newtonian gravity on and off a couple of times - let the game run for a few seconds in between each toggle on/off. While doing this, look at the gravity field produced (gravity grid is good for this).