View Single Post
Re: podbot grenade throwing bug
Old
  (#29)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: podbot grenade throwing bug - 13-07-2004

yea, this code looks somewhat mistaken to me.

I would think of
Code:
   // get a rough idea of how high it can be thrown
   vecMidPoint = vecSpot1 + (VecSpot2 - VecSpot1) * 0.5;
   TRACE_HULL (vecMidPoint, vecMidPoint + Vector (0, 0, 500), ignore_monsters, head_hull, pEdict, &tr);
   vecMidPoint = tr.vecEndPos;
   vecMidPoint.z--;
as the right code.

TRACE_HULL because a TraceLine would pass through the sky meshes whereas the grenade would bounce on it

And checking for flFraction is a bug since IF the grenade can actually reach 500 ft high (which is not that high in fact), then vecMidPoint would be left lined up with vecSpot1 and vecSpot2, which is NOT something we want, definitely.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote