.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Bug Reports (http://forums.bots-united.com/forumdisplay.php?f=49)
-   -   smoke grenade (http://forums.bots-united.com/showthread.php?t=2399)

Whistler 01-08-2004 06:22

smoke grenade
 
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);".

sPlOrYgOn 01-08-2004 18:57

Re: smoke grenade
 
Thanks Whistler! :)
You've helped this bot a lot


All times are GMT +2. The time now is 18:29.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.