All pastes #2071531 Raw Edit

Miscellany

public text v1 · immutable
#2071531 ·published 2011-05-29 09:28 UTC
rendered paste body
void IN_AttackDown(void)
{
   int k, i, imp, c = Cmd_Argc();
   
   // check if we have a keycode at the end, e.g. +fire 8 5 3 120
   // if it's >= 32, treat is as keycodes, otherwise an impulse
   k = 0;
   if (c >= 2 && atoi(Cmd_Argv(c - 1)) >= 32)
   {
        // it's a keycode
        k = atoi(Cmd_Argv(c - 1));
        c--;
   }
   
   for (i = 1; i < c; i++)
   {
      imp = atoi(Cmd_Argv(i));
      if (cl.stats[turn_the_impulse_into_IT_x(imp)]) {
        in_impulse = imp;
        break;
      }
   }
   
   KeyDown_common(&in_attack, k);
}