void CActorControllerComponent::OnActionKneelToggle()
{
	if (GetStance() == EActorStance::eAS_Kneeling)
		SetStance(EActorStance::eAS_Standing);
	else
		SetStance(EActorStance::eAS_Kneeling);
}
void CActorControllerComponent::OnActionSitToggle()
{
	if (GetStance() == EActorStance::eAS_SittingFloor)
		SetStance(EActorStance::eAS_Standing);
	else
		SetStance(EActorStance::eAS_SittingFloor);
}
void CActorControllerComponent::OnActionCrouchToggle()
{
	if (GetStance() == EActorStance::eAS_Crouching)
		SetStance(EActorStance::eAS_Standing);
	else
		SetStance(EActorStance::eAS_Crouching);
}
Пример #4
0
void cPlayer::MoveTo( const Vector3d & a_NewPos )
{
	if ((a_NewPos.y < -990) && (GetPosY() > -100))
	{
		// When attached to an entity, the client sends position packets with weird coords:
		// Y = -999 and X, Z = attempting to create speed, usually up to 0.03
		// We cannot test m_AttachedTo, because when deattaching, the server thinks the client is already deattached while 
		// the client may still send more of these nonsensical packets.
		if (m_AttachedTo != NULL)
		{
			Vector3d AddSpeed(a_NewPos);
			AddSpeed.y = 0;
			m_AttachedTo->AddSpeed(AddSpeed);
		}
		return;
	}
	
	// TODO: should do some checks to see if player is not moving through terrain
	// TODO: Official server refuses position packets too far away from each other, kicking "hacked" clients; we should, too

	Vector3d DeltaPos = a_NewPos - GetPosition();
	UpdateMovementStats(DeltaPos);
	
	SetPosition( a_NewPos );
	SetStance(a_NewPos.y + 1.62);
}