[Remove] Eradicated some useless target parameters.
This commit is contained in:
		
							parent
							
								
									8b0fbb8772
								
							
						
					
					
						commit
						febcfdbbb5
					
				
							
								
								
									
										4
									
								
								src/ai.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								src/ai.c
									
									
									
									
									
								
							@ -529,8 +529,8 @@ void ai_think(Pilot* pilot) {
 | 
				
			|||||||
            cur_pilot->solid->dir);
 | 
					            cur_pilot->solid->dir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* Fire weapons if needs be. */
 | 
					  /* Fire weapons if needs be. */
 | 
				
			||||||
  if(ai_isFlag(AI_PRIMARY)) pilot_shoot(pilot, cur_pilot->target, 0); /* Primary. */
 | 
					  if(ai_isFlag(AI_PRIMARY)) pilot_shoot(pilot, 0); /* Primary. */
 | 
				
			||||||
  if(ai_isFlag(AI_SECONDARY)) pilot_shoot(pilot, cur_pilot->target, 1); /* Secondary. */
 | 
					  if(ai_isFlag(AI_SECONDARY)) pilot_shoot(pilot, 1); /* Secondary. */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								src/pilot.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/pilot.c
									
									
									
									
									
								
							@ -57,7 +57,7 @@ extern void player_dead(void);
 | 
				
			|||||||
extern void player_destroyed(void);
 | 
					extern void player_destroyed(void);
 | 
				
			||||||
extern int gui_load(const char* name);
 | 
					extern int gui_load(const char* name);
 | 
				
			||||||
/* Internal. */
 | 
					/* Internal. */
 | 
				
			||||||
static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t);
 | 
					static void pilot_shootWeapon(Pilot* p, PilotOutfit* w);
 | 
				
			||||||
static void pilot_update(Pilot* pilot, const double dt);
 | 
					static void pilot_update(Pilot* pilot, const double dt);
 | 
				
			||||||
static void pilot_hyperspace(Pilot* pilot);
 | 
					static void pilot_hyperspace(Pilot* pilot);
 | 
				
			||||||
void pilot_render(Pilot* pilot);
 | 
					void pilot_render(Pilot* pilot);
 | 
				
			||||||
@ -204,7 +204,7 @@ int pilot_freeSpace(Pilot* p) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Mkay, this is how we shoot. Listen up. */
 | 
					/* Mkay, this is how we shoot. Listen up. */
 | 
				
			||||||
void pilot_shoot(Pilot* p, const unsigned int target, const int secondary) {
 | 
					void pilot_shoot(Pilot* p, const int secondary) {
 | 
				
			||||||
  int i;
 | 
					  int i;
 | 
				
			||||||
  Outfit* o;
 | 
					  Outfit* o;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -216,11 +216,11 @@ void pilot_shoot(Pilot* p, const unsigned int target, const int secondary) {
 | 
				
			|||||||
      o = p->outfits[i].outfit;
 | 
					      o = p->outfits[i].outfit;
 | 
				
			||||||
      if(!outfit_isProp(o, OUTFIT_PROP_WEAP_SECONDARY) &&
 | 
					      if(!outfit_isProp(o, OUTFIT_PROP_WEAP_SECONDARY) &&
 | 
				
			||||||
          (outfit_isBolt(o) || outfit_isBeam(o))) /** @todo Possibly make the neater. */
 | 
					          (outfit_isBolt(o) || outfit_isBeam(o))) /** @todo Possibly make the neater. */
 | 
				
			||||||
        pilot_shootWeapon(p, &p->outfits[i], target);
 | 
					        pilot_shootWeapon(p, &p->outfits[i]);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    if(!p->secondary) return; /* No secondary weapon. */
 | 
					    if(!p->secondary) return; /* No secondary weapon. */
 | 
				
			||||||
    pilot_shootWeapon(p, p->secondary, target);
 | 
					    pilot_shootWeapon(p, p->secondary);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -258,14 +258,14 @@ void pilot_shootStop(Pilot* p, const int secondary) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @fn static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t)
 | 
					 * @fn static void pilot_shootWeapon(Pilot* p, PilotOutfit* w)
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * @brief Actually handles the shooting, how often the player can shoot and such.
 | 
					 * @brief Actually handles the shooting, how often the player can shoot and such.
 | 
				
			||||||
 *    @param p Pilot that is shooting.
 | 
					 *    @param p Pilot that is shooting.
 | 
				
			||||||
 *    @param w Pilot's outfit to shoot.
 | 
					 *    @param w Pilot's outfit to shoot.
 | 
				
			||||||
 *    @param t Pilot's target.
 | 
					 *    @param t Pilot's target.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
 | 
					static void pilot_shootWeapon(Pilot* p, PilotOutfit* w) {
 | 
				
			||||||
  int quantity, delay;
 | 
					  int quantity, delay;
 | 
				
			||||||
  /* WElll... Trying to shoot when you have no ammo?? FUUU */
 | 
					  /* WElll... Trying to shoot when you have no ammo?? FUUU */
 | 
				
			||||||
  quantity = pilot_oquantity(p,w);
 | 
					  quantity = pilot_oquantity(p,w);
 | 
				
			||||||
@ -282,7 +282,7 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    p->energy -= outfit_energy(w->outfit);
 | 
					    p->energy -= outfit_energy(w->outfit);
 | 
				
			||||||
    weapon_add(w->outfit, p->solid->dir,
 | 
					    weapon_add(w->outfit, p->solid->dir,
 | 
				
			||||||
        &p->solid->pos, &p->solid->vel, p->id, t);
 | 
					        &p->solid->pos, &p->solid->vel, p->id, p->target);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* Beam Weapons. */
 | 
					  /* Beam Weapons. */
 | 
				
			||||||
@ -292,7 +292,7 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
 | 
				
			|||||||
    /** @todo Handle warmup stage. */
 | 
					    /** @todo Handle warmup stage. */
 | 
				
			||||||
    w->state = PILOT_OUTFIT_ON;
 | 
					    w->state = PILOT_OUTFIT_ON;
 | 
				
			||||||
    w->beamid = beam_start(w->outfit, p->solid->dir,    
 | 
					    w->beamid = beam_start(w->outfit, p->solid->dir,    
 | 
				
			||||||
      &p->solid->pos, &p->solid->vel, p->id, t);
 | 
					      &p->solid->pos, &p->solid->vel, p->id, p->target);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*
 | 
					  /*
 | 
				
			||||||
@ -302,7 +302,7 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  else if(outfit_isLauncher(w->outfit) && (w == p->secondary)) {
 | 
					  else if(outfit_isLauncher(w->outfit) && (w == p->secondary)) {
 | 
				
			||||||
    /* Shooter can't be the target - Sanity check for the player. */
 | 
					    /* Shooter can't be the target - Sanity check for the player. */
 | 
				
			||||||
    if((w->outfit->type != OUTFIT_TYPE_MISSILE_DUMB) && (p->id == t))
 | 
					    if((w->outfit->type != OUTFIT_TYPE_MISSILE_DUMB) && (p->id == p->target))
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Must have ammo left. */
 | 
					    /* Must have ammo left. */
 | 
				
			||||||
@ -315,7 +315,7 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    p->energy -= outfit_energy(w->outfit);
 | 
					    p->energy -= outfit_energy(w->outfit);
 | 
				
			||||||
    weapon_add(p->ammo->outfit, p->solid->dir, &p->solid->pos,
 | 
					    weapon_add(p->ammo->outfit, p->solid->dir, &p->solid->pos,
 | 
				
			||||||
               &p->solid->vel, p->id, t);
 | 
					               &p->solid->vel, p->id, p->target);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    p->ammo->quantity -= 1; /* There's no getting this one back. */
 | 
					    p->ammo->quantity -= 1; /* There's no getting this one back. */
 | 
				
			||||||
    if(p->ammo->quantity <= 0) /* Out of ammo. */
 | 
					    if(p->ammo->quantity <= 0) /* Out of ammo. */
 | 
				
			||||||
 | 
				
			|||||||
@ -221,7 +221,7 @@ Fleet* fleet_get(const char* name);
 | 
				
			|||||||
int pilot_getJumps(const Pilot* p);
 | 
					int pilot_getJumps(const Pilot* p);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Misc. */
 | 
					/* Misc. */
 | 
				
			||||||
void pilot_shoot(Pilot* p, const unsigned int target, const int secondary);
 | 
					void pilot_shoot(Pilot* p, const int secondary);
 | 
				
			||||||
void pilot_shootStop(Pilot* p, const int secondary);
 | 
					void pilot_shootStop(Pilot* p, const int secondary);
 | 
				
			||||||
void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter,
 | 
					void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter,
 | 
				
			||||||
    const DamageType dtype, const double damage);
 | 
					    const DamageType dtype, const double damage);
 | 
				
			||||||
 | 
				
			|||||||
@ -1564,7 +1564,7 @@ void player_think(Pilot* pplayer) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  /* Primary weapon. */
 | 
					  /* Primary weapon. */
 | 
				
			||||||
  if(player_isFlag(PLAYER_PRIMARY)) {
 | 
					  if(player_isFlag(PLAYER_PRIMARY)) {
 | 
				
			||||||
    pilot_shoot(pplayer, player->target, 0);
 | 
					    pilot_shoot(pplayer, 0);
 | 
				
			||||||
    player_setFlag(PLAYER_PRIMARY_L);
 | 
					    player_setFlag(PLAYER_PRIMARY_L);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else if(player_isFlag(PLAYER_PRIMARY_L)) {
 | 
					  else if(player_isFlag(PLAYER_PRIMARY_L)) {
 | 
				
			||||||
@ -1580,7 +1580,7 @@ void player_think(Pilot* pplayer) {
 | 
				
			|||||||
         outfit_isBeam(pplayer->secondary->outfit)) {
 | 
					         outfit_isBeam(pplayer->secondary->outfit)) {
 | 
				
			||||||
       pilot_shootStop(pplayer, 1);
 | 
					       pilot_shootStop(pplayer, 1);
 | 
				
			||||||
     } else
 | 
					     } else
 | 
				
			||||||
       pilot_shoot(pplayer, player->target, 1);
 | 
					       pilot_shoot(pplayer, 1);
 | 
				
			||||||
    player_setFlag(PLAYER_SECONDARY_L);
 | 
					    player_setFlag(PLAYER_SECONDARY_L);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else if(player_isFlag(PLAYER_SECONDARY_L)) {
 | 
					  else if(player_isFlag(PLAYER_SECONDARY_L)) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user