Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 04-21-2017, 10:31 AM   #1
Comaaz
 
Join Date: Sep 2012
Reputation: 0
Posts: 80
Prevent fall damage

Hi. I've been trying to make it so while the player is touching a brush entity the entity forces all fall damage to be cleared but it doesn't seem to be working.

Here's what I have written:

Code:
void CTriggerVelocityOverride::Launch(CBaseEntity *pActivator)
{

	

//		VectorNormalize(m_vecForceDirection);
		if (m_fForce == NULL)
			m_fForce = 0.0f;
		if (m_fForce > 1000)
			m_fForce = 1000.0f;

		pActivator->SetAbsVelocity(m_vecForceDirection * m_fForce);

		if (pActivator->IsPlayer())
		{
			CBasePlayer *pPlayer = static_cast<CBasePlayer*>(pActivator);
			pPlayer->m_Local.m_flFallVelocity = 0.0f;
		}
}
This function should get called all the time when the player is touching the brush trigger, but its still applying fall damage. What could I be doing wrong here?
Comaaz is offline  
Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2015, All Rights Reserved.