From 53fbfdf0aa83623428d9a14a3f8f3ffb80eb7c5a Mon Sep 17 00:00:00 2001 From: puzl Date: Fri, 28 Apr 2006 01:01:28 +0000 Subject: [PATCH] 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 --- releases/3.2.0/source/dlls/player.cpp | 42 ++++++++++++--------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/releases/3.2.0/source/dlls/player.cpp b/releases/3.2.0/source/dlls/player.cpp index b7af908d..f3878a00 100644 --- a/releases/3.2.0/source/dlls/player.cpp +++ b/releases/3.2.0/source/dlls/player.cpp @@ -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;