Player: SetSize() after the .flags field update in case their bbox changed
and we aren't running physics on their entity. Viewmodels: Add cvar v_modellag (Default: 0)
This commit is contained in:
parent
5bf3545e69
commit
d25a597d71
3 changed files with 23 additions and 2 deletions
|
@ -190,5 +190,5 @@ struct
|
||||||
float m_flShakeTime;
|
float m_flShakeTime;
|
||||||
float m_flShakeAmp;
|
float m_flShakeAmp;
|
||||||
|
|
||||||
entity m_pWeaponFX;
|
vector m_vecLag;
|
||||||
} g_seats[4], *pSeat;
|
} g_seats[4], *pSeat;
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var int autocvar_v_modellag = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
View_Init(void)
|
View_Init(void)
|
||||||
{
|
{
|
||||||
|
@ -124,7 +126,20 @@ View_DrawViewModel(void)
|
||||||
m_eViewModel.frame1time, ClientGame_ModelEvent);
|
m_eViewModel.frame1time, ClientGame_ModelEvent);
|
||||||
|
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
m_eViewModel.angles = view_angles;
|
|
||||||
|
if (autocvar_v_modellag == 0)
|
||||||
|
m_eViewModel.angles = view_angles;
|
||||||
|
else {
|
||||||
|
makevectors(pSeat->m_vecLag);
|
||||||
|
pSeat->m_vecLag = v_forward;
|
||||||
|
makevectors(view_angles);
|
||||||
|
pSeat->m_vecLag[0] = Math_Lerp(pSeat->m_vecLag[0], v_forward[0], clframetime * 20);
|
||||||
|
pSeat->m_vecLag[1] = Math_Lerp(pSeat->m_vecLag[1], v_forward[1], clframetime * 20);
|
||||||
|
pSeat->m_vecLag[2] = Math_Lerp(pSeat->m_vecLag[2], v_forward[2], clframetime * 20);
|
||||||
|
pSeat->m_vecLag = vectoangles(pSeat->m_vecLag);
|
||||||
|
m_eViewModel.angles = pSeat->m_vecLag;
|
||||||
|
}
|
||||||
|
|
||||||
m_eViewModel.colormap = pSeat->m_ePlayer.colormap;
|
m_eViewModel.colormap = pSeat->m_ePlayer.colormap;
|
||||||
|
|
||||||
/* now apply the scale hack */
|
/* now apply the scale hack */
|
||||||
|
|
|
@ -72,6 +72,12 @@ base_player::ReceiveEntity(float new, float fl)
|
||||||
flags = readfloat();
|
flags = readfloat();
|
||||||
gflags = readfloat();
|
gflags = readfloat();
|
||||||
pmove_flags = readfloat();
|
pmove_flags = readfloat();
|
||||||
|
|
||||||
|
/* mainly used for other players receiving us */
|
||||||
|
if (flags & FL_CROUCHING)
|
||||||
|
setsize(self, PHY_HULL_CROUCHED_MIN, PHY_HULL_CROUCHED_MAX);
|
||||||
|
else
|
||||||
|
setsize(self, PHY_HULL_MIN, PHY_HULL_MAX);
|
||||||
}
|
}
|
||||||
if (fl & PLAYER_WEAPON)
|
if (fl & PLAYER_WEAPON)
|
||||||
activeweapon = readbyte();
|
activeweapon = readbyte();
|
||||||
|
|
Loading…
Reference in a new issue