networking fixes
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
void CMOBAPlayer::Spawn()
|
||||
{
|
||||
CPhysicsProp::Spawn();
|
||||
CBaseEntity::Spawn();
|
||||
SetModel("game/core/models/cube.fmdl");
|
||||
SetScale(1);
|
||||
SetThink(Think);
|
||||
@@ -14,8 +14,14 @@ void CMOBAPlayer::Spawn()
|
||||
|
||||
void CMOBAPlayer::Think( float fDelta )
|
||||
{
|
||||
V_printf("%f %f %f\n", m_vMovementVector.x, m_vMovementVector.y, m_vMovementVector.z);
|
||||
CPhysicsProp::Think(fDelta);
|
||||
Vector vPosition = GetAbsOrigin();
|
||||
// player might lie to us
|
||||
m_vMovementVector.x = glm_clamp(m_vMovementVector.x, -1, 1);
|
||||
m_vMovementVector.y = glm_clamp(m_vMovementVector.y, -1, 1);
|
||||
|
||||
vPosition.x += m_vMovementVector.x*fDelta*5;
|
||||
vPosition.z += m_vMovementVector.z*fDelta*5;
|
||||
SetAbsOrigin(vPosition);
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS(player, CMOBAPlayer)
|
||||
|
||||
Reference in New Issue
Block a user