Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by Anonymous ( 12 years ago )
int player_autonavShouldResetSpeed( int damaged )
{
   double failpc = conf.autonav_reset_speed * abort_mod;
   double shield = player.p->shield / player.p->shield_max;
   double armour = player.p->armour / player.p->armour_max;
    char *reas
   /*unsigned int eid;
   Pilot *enemy;*/
   int i;
   Pilot **pstk;
   int n;
   int hostiles = 0;

   if (!player_isFlag(PLAYER_AUTONAV))
      return 0;

   /*eid = pilot_getNearestEnemy( player.p );
   if (eid != 0)
   {
      enemy = pilot_get( eid );
      if (pilot_inRangePilot( player.p, enemy ))
         hostiles = 1;
   }*/
   pstk  = pilot_getAll( &n );
   for (i=0; i<n; i++) {
      if ((pstk[i]->id != PLAYER_ID) && pilot_inRangePilot( player.p, pstk[i] ))
      {
         hostiles = 1;
         break;
      }
   }

   if (failpc >= 1. && hostiles)
       reas;
   else if (failpc >= 1. && (shield < 1. && shield < lasts) && damaged)
       reas;
   else if (failpc > 0. && (shield < failpc) && damaged)
       reas;
   else if (armour < lasta && damaged)
       reas;

   lasts = player.p->shield / player.p->shield_max;
   lasta = player.p->armour / player.p->armour_max;

   if (reason) {
      player_autonavResetSpeed();
      if (player.autonav_timer > 0.)
         abort_mod = MIN( MAX( 0., abort_mod - .25 ), (int)(shield * 4) * .25 );
      else
         abort_mod = MIN( 0.75, (int)(shield * 4) * .25 );
       player.aut
      return 1;
   }
   return 0;
}

 

Revise this Paste

Your Name: Code Language: