7 #include "gb/moveplanet.h" 11 #include "gb/doturn.h" 13 #include "gb/tweakables.h" 16 void moveplanet(
int starnum, Planet *planet,
int planetnum) {
25 if (planet->popn || planet->ships) Stinfo[starnum][planetnum].inhab = 1;
28 !!(Stars[starnum]->inhabited[0] + Stars[starnum]->inhabited[1]);
30 !!(Stars[starnum]->explored[0] + Stars[starnum]->explored[1]);
32 Stars[starnum]->inhabited[0] = Stars[starnum]->inhabited[1] = 0;
33 if (!StarsExpl[starnum])
return;
35 dist = hypot((
double)(planet->ypos), (
double)(planet->xpos));
37 phase = atan2((
double)(planet->ypos), (
double)(planet->xpos));
39 dist * sqrt((
double)(dist / (
SYSTEMGRAVCONST * Stars[starnum]->gravity)));
42 xadd = dist * cos((
double)(-1. / period + phase)) - planet->xpos;
43 yadd = dist * sin((
double)(-1. / period + phase)) - planet->ypos;
void moveplanet(int, Planet *, int)