Thread: smoke grenade
View Single Post
smoke grenade
Old
  (#1)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default smoke grenade - 01-08-2004

I have found that CF has messed the absolute vector and just a "direction" in the smoke grenade code:
Code:
   // tries to throw the Gren on the ground
   case TASK_THROWSMOKEGRENADE:
      pBot->iAimFlags |= AIM_GRENADE;
      if (!(pBot->iStates & STATE_SEEINGENEMY))
      {
         pBot->f_move_speed = 0.0;
         pBot->f_sidemove_speed = 0.0;
         bMoveToGoal = FALSE;
      }
      pBot->bCheckTerrain = FALSE;
      pBot->bUsingGrenade = TRUE;
      v_src = pBot->vecLastEnemyOrigin;
      v_src = v_src - pEdict->v.velocity;

      // Predict where the enemy is in 0.5 secs
      if (!FNullEnt (pBot->pBotEnemy))
         v_src = v_src + pBot->pBotEnemy->v.velocity * 0.5;

      pBot->vecGrenade = v_src;
and in ChooseAimDirection():
Code:
   else if (iFlags & AIM_GRENADE)
      pBot->vecLookAt = GetGunPosition (pBot->pEdict) + (pBot->vecGrenade.Normalize () * 1);
this seems to be wrong. the first one "pBot->vecGrenade = v_src;" should rather be "pBot->vecGrenade = v_src - GetGunPosition(pBot->pEdict);".

Last edited by Whistler; 01-08-2004 at 06:26..
  
Reply With Quote