o Revert range change on +use for hives as it caused issues when using other items.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@429 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-04-28 01:01:28 +00:00
parent 55ee213145
commit 53fbfdf0aa

View file

@ -92,7 +92,6 @@
#include "game.h"
#include "common/hltv.h"
#include "mod/AvHNetworkMessages.h"
#include "util/MathUtil.h"
// #define DUCKFIX
@ -1779,31 +1778,28 @@ void CBasePlayer::PlayerUse ( void )
UTIL_MakeVectors ( pev->v_angle );// so we know which way we are facing
while ((pObject = UTIL_FindEntityInSphere( pObject, pev->origin, PLAYER_SEARCH_RADIUS*2 )) != NULL)
while ((pObject = UTIL_FindEntityInSphere( pObject, pev->origin, PLAYER_SEARCH_RADIUS )) != NULL)
{
float distance=VectorDistance(pObject->pev->origin, pev->origin);
if ( distance < PLAYER_SEARCH_RADIUS || pObject->pev->iuser3 == AVH_USER3_HIVE ) {
if (pObject->ObjectCaps() & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE))
{
// !!!PERFORMANCE- should this check be done on a per case basis AFTER we've determined that
// this object is actually usable? This dot is being done for every object within PLAYER_SEARCH_RADIUS
// when player hits the use key. How many objects can be in that area, anyway? (sjb)
vecLOS = (VecBModelOrigin( pObject->pev ) - (pev->origin + pev->view_ofs));
// This essentially moves the origin of the target to the corner nearest the player to test to see
// if it's "hull" is in the view cone
vecLOS = UTIL_ClampVectorToBox( vecLOS, pObject->pev->size * 0.5 );
flDot = DotProduct (vecLOS , gpGlobals->v_forward);
if (flDot > flMaxDot )
{// only if the item is in front of the user
pClosest = pObject;
flMaxDot = flDot;
// ALERT( at_console, "%s : %f\n", STRING( pObject->pev->classname ), flDot );
}
// ALERT( at_console, "%s : %f\n", STRING( pObject->pev->classname ), flDot );
if (pObject->ObjectCaps() & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE))
{
// !!!PERFORMANCE- should this check be done on a per case basis AFTER we've determined that
// this object is actually usable? This dot is being done for every object within PLAYER_SEARCH_RADIUS
// when player hits the use key. How many objects can be in that area, anyway? (sjb)
vecLOS = (VecBModelOrigin( pObject->pev ) - (pev->origin + pev->view_ofs));
// This essentially moves the origin of the target to the corner nearest the player to test to see
// if it's "hull" is in the view cone
vecLOS = UTIL_ClampVectorToBox( vecLOS, pObject->pev->size * 0.5 );
flDot = DotProduct (vecLOS , gpGlobals->v_forward);
if (flDot > flMaxDot )
{// only if the item is in front of the user
pClosest = pObject;
flMaxDot = flDot;
// ALERT( at_console, "%s : %f\n", STRING( pObject->pev->classname ), flDot );
}
// ALERT( at_console, "%s : %f\n", STRING( pObject->pev->classname ), flDot );
}
}
pObject = pClosest;