mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Mapbase v4.3
- Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "vehicle_base.h"
|
||||
#ifdef MAPBASE
|
||||
#include "mapbase/GlobalStrings.h"
|
||||
#include "collisionutils.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
@@ -2655,6 +2656,9 @@ private:
|
||||
string_t m_iszInSequence;
|
||||
string_t m_iszOutSequence;
|
||||
string_t m_iszLockedSequence;
|
||||
|
||||
Vector m_vecUseMins;
|
||||
Vector m_vecUseMaxs;
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( prop_interactable, CInteractableProp );
|
||||
@@ -2672,6 +2676,9 @@ BEGIN_DATADESC( CInteractableProp )
|
||||
DEFINE_KEYFIELD( m_iszOutSequence, FIELD_STRING, "OutSequence" ),
|
||||
DEFINE_KEYFIELD( m_iszLockedSequence, FIELD_STRING, "LockedSequence" ),
|
||||
|
||||
DEFINE_KEYFIELD( m_vecUseMins, FIELD_VECTOR, "use_mins" ),
|
||||
DEFINE_KEYFIELD( m_vecUseMaxs, FIELD_VECTOR, "use_maxs" ),
|
||||
|
||||
// Inputs
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "Lock", InputLock ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "Unlock", InputUnlock ),
|
||||
@@ -2732,6 +2739,29 @@ void CInteractableProp::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
|
||||
if (m_flCooldownTime > gpGlobals->curtime)
|
||||
return;
|
||||
|
||||
// If we're using +USE mins/maxs, make sure this is being +USE'd from the right place
|
||||
if (m_vecUseMins.LengthSqr() != 0.0f && m_vecUseMaxs.LengthSqr() != 0.0f)
|
||||
{
|
||||
CBasePlayer *pPlayer = ToBasePlayer( pActivator );
|
||||
if (pPlayer)
|
||||
{
|
||||
Vector forward;
|
||||
pPlayer->EyeVectors( &forward, NULL, NULL );
|
||||
|
||||
// This might be a little convoluted and/or seem needlessly expensive, but I couldn't figure out any better way to do this.
|
||||
// TOOD: Can we calculate a box in local space instead of world space?
|
||||
Vector vecWorldMins, vecWorldMaxs;
|
||||
RotateAABB( EntityToWorldTransform(), m_vecUseMins, m_vecUseMaxs, vecWorldMins, vecWorldMaxs );
|
||||
TransformAABB( EntityToWorldTransform(), vecWorldMins, vecWorldMaxs, vecWorldMins, vecWorldMaxs );
|
||||
if (!IsBoxIntersectingRay( vecWorldMins, vecWorldMaxs, pPlayer->EyePosition(), forward * 1024 ))
|
||||
{
|
||||
// Reject this +USE if it's not in our box
|
||||
DevMsg("Outside of +USE box\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nSequence = -1;
|
||||
|
||||
if (m_bLocked)
|
||||
|
||||
Reference in New Issue
Block a user