Pages:<< prev 1 next >>
Fledgling

GroupMembers
Posts14
JoinedMar 29, 2024
if ( ship->sclass != SHIP_SPACE_STATION && !autofly(ship) )
{
if ( ship->starsystem->star1 && strcmp(ship->starsystem->star1,""
)
{
if (ship->vx >= ship->starsystem->s1x + 1 || ship->vx <= ship->starsystem->s1x - 1 )
ship->vx -= URANGE(-3,(ship->starsystem->gravitys1)/(ship->vx - ship->starsystem->s1x)/2,3);
if (ship->vy >= ship->starsystem->s1y + 1 || ship->vy <= ship->starsystem->s1y - 1 )
ship->vy -= URANGE(-3,(ship->starsystem->gravitys1)/(ship->vy - ship->starsystem->s1y)/2,3);
if (ship->vz >= ship->starsystem->s1z + 1 || ship->vz <= ship->starsystem->s1z - 1 )
ship->vz -= URANGE(-3,(ship->starsystem->gravitys1)/(ship->vz - ship->starsystem->s1z)/2,3);
}
if ( ship->starsystem->star2 && strcmp(ship->starsystem->star2,""
)
{
if (ship->vx >= ship->starsystem->s2x + 1 || ship->vx <= ship->starsystem->s2x - 1 )
ship->vx -= URANGE(-3,(ship->starsystem->gravitys2)/(ship->vx - ship->starsystem->s2x)/2,3);
if (ship->vy >= ship->starsystem->s2y + 1 || ship->vy <= ship->starsystem->s2y - 1 )
ship->vy -= URANGE(-3,(ship->starsystem->gravitys2)/(ship->vy - ship->starsystem->s2y)/2,3);
if (ship->vz >= ship->starsystem->s2z + 1 || ship->vz <= ship->starsystem->s2z - 1 )
ship->vz -= URANGE(-3,(ship->starsystem->gravitys2)/(ship->vz - ship->starsystem->s2z)/2,3);
}
if ( ship->starsystem->planet1 && strcmp(ship->starsystem->planet1,""
)
{
if (ship->vx >= ship->starsystem->p1x + 1 || ship->vx <= ship->starsystem->p1x - 1 )
ship->vx -= URANGE(-3,(ship->starsystem->gravityp1)/(ship->vx - ship->starsystem->p1x)/2,3);
if (ship->vy >= ship->starsystem->p1y + 1 || ship->vy <= ship->starsystem->p1y - 1 )
ship->vy -= URANGE(-3,(ship->starsystem->gravityp1)/(ship->vy - ship->starsystem->p1y)/2,3);
if (ship->vz >= ship->starsystem->p1z + 1 || ship->vz <= ship->starsystem->p1z - 1 )
ship->vz -= URANGE(-3,(ship->starsystem->gravityp1)/(ship->vz - ship->starsystem->p1z)/2,3);
}
if ( ship->starsystem->planet2 && strcmp(ship->starsystem->planet2,""
)
{
if (ship->vx >= ship->starsystem->p2x + 1 || ship->vx <= ship->starsystem->p2x - 1 )
ship->vx -= URANGE(-3,(ship->starsystem->gravityp2)/(ship->vx - ship->starsystem->p2x)/2,3);
if (ship->vy >= ship->starsystem->p2y + 1 || ship->vy <= ship->starsystem->p2y - 1 )
ship->vy -= URANGE(-3,(ship->starsystem->gravityp2)/(ship->vy - ship->starsystem->p2y)/2,3);
if (ship->vz >= ship->starsystem->p2z + 1 || ship->vz <= ship->starsystem->p2z - 1 )
ship->vz -= URANGE(-3,(ship->starsystem->gravityp2)/(ship->vz - ship->starsystem->p2z)/2,3);
}
if ( ship->starsystem->planet3 && strcmp(ship->starsystem->planet3,""
)
{
if (ship->vx >= ship->starsystem->p3x + 1 || ship->vx <= ship->starsystem->p3x - 1 )
ship->vx -= URANGE(-3,(ship->starsystem->gravityp3)/(ship->vx - ship->starsystem->p3x)/2,3);
if (ship->vy >= ship->starsystem->p3y + 1 || ship->vy <= ship->starsystem->p3y - 1 )
ship->vy -= URANGE(-3,(ship->starsystem->gravityp3)/(ship->vy - ship->starsystem->p3y)/2,3);
if (ship->vz >= ship->starsystem->p3z + 1 || ship->vz <= ship->starsystem->p3z - 1 )
ship->vz -= URANGE(-3,(ship->starsystem->gravityp3)/(ship->vz - ship->starsystem->p3z)/2,3);
}
}
//
//
for ( target = ship->starsystem->first_ship; target; target = target->next_in_starsystem)
{
if ( target != ship &&
abs(ship->vx - target->vx) < 1 &&
abs(ship->vy - target->vy) < 1 &&
abs(ship->vz - target->vz) < 1 )
{
ship->collision = target->maxhull;
target->collision = ship->maxhull;
}
}
Anyone happen to know why this might have been commented out in Starwars? I uncommented it, it compiled fine. I tried it out but not finding a exact reasoning or anything out of ordinary with this.
Geomancer

GroupAdministrators
Posts1,992
JoinedJul 26, 2005
// is normally used for comments on that line so removing the // shouldn't affect anything as long as it is an empty line. If it will be longer than a single line they like to put them in /* */
Fledgling

GroupMembers
Posts14
JoinedMar 29, 2024
haha no not those.. i know those are comment outs.. i missed removing those. it was my marker as to what was commented out
That whole section of code is what i was talking about as it all was commented out
That whole section of code is what i was talking about as it all was commented out
Geomancer

GroupAdministrators
Posts1,992
JoinedJul 26, 2005
oh well id be simply guessing if I tried to guess why it was commented out lol. You probably have far more knowledge on that code base than I do lol
Pages:<< prev 1 next >>