components/prboom/p_map.c
//
// P_UseLines
// Looks for special lines in front of the player to activate.
//
P_UseLines
Looks for special lines in front of the player to activate.
P_UseLines Looks for special lines in front of the player to activate .
void P_UseLines (player_t*  player)
  {
  int     angle;
  fixed_t x1;
  fixed_t y1;
  fixed_t x2;
  fixed_t y2;
  usething = player->mo;
  angle = player->mo->angle >> ANGLETOFINESHIFT;
  x1 = player->mo->x;
  y1 = player->mo->y;
  x2 = x1 + (USERANGE>>FRACBITS)*finecosine[angle];
  y2 = y1 + (USERANGE>>FRACBITS)*finesine[angle];
   P_PathTraverse ( x1, y1, x2, y2, PT_ADDLINES, PTR_UseTraverse );
   This added test makes the "oof" sound work on 2s lines -- killough:
  if (P_PathTraverse ( x1, y1, x2, y2, PT_ADDLINES, PTR_UseTraverse ))
    if (!comp[comp_sound] && !P_PathTraverse ( x1, y1, x2, y2, PT_ADDLINES, PTR_NoWayTraverse ))
      S_StartSound (usething, sfx_noway);
  }
void P_UseLines ( player_t * player ) { int angle ; fixed_t x1 ; fixed_t y1 ; fixed_t x2 ; fixed_t y2 ; usething = player -> mo ; angle = player -> mo -> angle >> ANGLETOFINESHIFT ; x1 = player -> mo -> x ; y1 = player -> mo -> y ; x2 = x1 + ( USERANGE >> FRACBITS ) * finecosine [ angle ] ; y2 = y1 + ( USERANGE >> FRACBITS ) * finesine [ angle ] ; if ( P_PathTraverse ( x1 , y1 , x2 , y2 , PT_ADDLINES , PTR_UseTraverse ) ) if ( ! comp [ comp_sound ] && ! P_PathTraverse ( x1 , y1 , x2 , y2 , PT_ADDLINES , PTR_NoWayTraverse ) ) S_StartSound ( usething , sfx_noway ) ; }
P_UseLines
Looks for special lines in front of the player to activate.
P_UseLines Looks for special lines in front of the player to activate .
// old code: // // P_PathTraverse ( x1, y1, x2, y2, PT_ADDLINES, PTR_UseTraverse ); // // This added test makes the "oof" sound work on 2s lines -- killough: