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:
@@ -6,6 +6,10 @@
|
||||
#include "cbase.h"
|
||||
#include "predicted_viewmodel.h"
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
#include "prediction.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
@@ -24,6 +28,7 @@ CPredictedViewModel::CPredictedViewModel() : m_LagAnglesHistory("CPredictedViewM
|
||||
{
|
||||
m_vLagAngles.Init();
|
||||
m_LagAnglesHistory.Setup( &m_vLagAngles, 0 );
|
||||
m_vPredictedOffset.Init();
|
||||
}
|
||||
#else
|
||||
CPredictedViewModel::CPredictedViewModel()
|
||||
@@ -46,26 +51,53 @@ ConVar cl_wpn_sway_scale( "cl_wpn_sway_scale", "1.0", FCVAR_CLIENTDLL|FCVAR_CHEA
|
||||
|
||||
void CPredictedViewModel::CalcViewModelLag( Vector& origin, QAngle& angles, QAngle& original_angles )
|
||||
{
|
||||
#ifdef CLIENT_DLL
|
||||
// Calculate our drift
|
||||
Vector forward, right, up;
|
||||
AngleVectors( angles, &forward, &right, &up );
|
||||
|
||||
// Add an entry to the history.
|
||||
m_vLagAngles = angles;
|
||||
m_LagAnglesHistory.NoteChanged( gpGlobals->curtime, cl_wpn_sway_interp.GetFloat(), false );
|
||||
|
||||
// Interpolate back 100ms.
|
||||
m_LagAnglesHistory.Interpolate( gpGlobals->curtime, cl_wpn_sway_interp.GetFloat() );
|
||||
|
||||
// Now take the 100ms angle difference and figure out how far the forward vector moved in local space.
|
||||
Vector vLaggedForward;
|
||||
QAngle angleDiff = m_vLagAngles - angles;
|
||||
AngleVectors( -angleDiff, &vLaggedForward, 0, 0 );
|
||||
Vector vForwardDiff = Vector(1,0,0) - vLaggedForward;
|
||||
#ifdef CLIENT_DLL
|
||||
#ifdef SDK_DLL
|
||||
//DM- take care of prediction first
|
||||
if ( prediction->InPrediction() && !prediction->IsFirstTimePredicted() )
|
||||
{
|
||||
origin += m_vPredictedOffset;
|
||||
return;
|
||||
}
|
||||
|
||||
// Now offset the origin using that.
|
||||
vForwardDiff *= cl_wpn_sway_scale.GetFloat();
|
||||
origin += forward*vForwardDiff.x + right*-vForwardDiff.y + up*vForwardDiff.z;
|
||||
#endif
|
||||
Vector oldOrigin = origin;
|
||||
BaseClass::CalcViewModelLag( origin, angles, original_angles );
|
||||
|
||||
m_vPredictedOffset = origin - oldOrigin;
|
||||
|
||||
return; //kick it back off to CBaseViewModel for proper computation,
|
||||
//don't perform the unnecessary checks below
|
||||
#endif
|
||||
float interp = cl_wpn_sway_interp.GetFloat();
|
||||
if ( !interp )
|
||||
return;
|
||||
|
||||
if ( prediction->InPrediction() && !prediction->IsFirstTimePredicted() )
|
||||
{
|
||||
origin += m_vPredictedOffset;
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate our drift
|
||||
Vector forward, right, up;
|
||||
AngleVectors( angles, &forward, &right, &up );
|
||||
|
||||
// Add an entry to the history.
|
||||
m_vLagAngles = angles;
|
||||
m_LagAnglesHistory.NoteChanged( gpGlobals->curtime, interp, false );
|
||||
|
||||
// Interpolate back 100ms.
|
||||
m_LagAnglesHistory.Interpolate( gpGlobals->curtime, interp );
|
||||
|
||||
// Now take the 100ms angle difference and figure out how far the forward vector moved in local space.
|
||||
Vector vLaggedForward;
|
||||
QAngle angleDiff = m_vLagAngles - angles;
|
||||
AngleVectors( -angleDiff, &vLaggedForward, 0, 0 );
|
||||
Vector vForwardDiff = Vector(1,0,0) - vLaggedForward;
|
||||
|
||||
// Now offset the origin using that.
|
||||
vForwardDiff *= cl_wpn_sway_scale.GetFloat();
|
||||
m_vPredictedOffset = forward*vForwardDiff.x + right*-vForwardDiff.y + up*vForwardDiff.z;
|
||||
origin += m_vPredictedOffset;
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user