Removing fall damage: Difference between revisions
Jump to navigation
Jump to search
Bug:This code block does not exist in HL2MP
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified) |
No edit summary |
||
Line 4: | Line 4: | ||
Removing fall damage is a simple process in sp 2013, I have yet to try it in other versions, yet the principle should work across all versions. | Removing fall damage is a simple process in sp 2013, I have yet to try it in other versions, yet the principle should work across all versions. | ||
{{bug|hidetested=1|This code block does not exist in HL2MP}} | {{bug|hidetested=1|This code block does not exist in HL2MP}} | ||
= Editing | |||
== | =Editing the code= | ||
==Singleolayer 2013== | |||
# Find '''''hl2_player.cpp''''' in the server project in the '''''Server(game)/Source Files\HL2 DLL\hl2_player.cpp''''' or in the local file path of '''''src/game/server/hl2/hl2_player.cpp''''' <br> | |||
<source lang=cpp> | # Find the following '''if''' statement in the file ([[:User:Emersont1|I]] found it on lines 2294-2303): <source lang=cpp> | ||
// ignore fall damage if instructed to do so by input | // ignore fall damage if instructed to do so by input | ||
if ( ( info.GetDamageType() & DMG_FALL ) && m_flTimeIgnoreFallDamage > gpGlobals->curtime ) | if ( ( info.GetDamageType() & DMG_FALL ) && m_flTimeIgnoreFallDamage > gpGlobals->curtime ) | ||
Line 20: | Line 20: | ||
} | } | ||
return 0; | return 0; | ||
} | }</source> | ||
</source> | # Alter or comment the code to make it look like this: <source lang=cpp> | ||
<source lang=cpp> | |||
// Always Ignore Fall Damage | // Always Ignore Fall Damage | ||
if ( info.GetDamageType() & DMG_FALL ) | if ( info.GetDamageType() & DMG_FALL ) | ||
{ | { | ||
return 0; | return 0; | ||
} | }</source> | ||
</source> | |||
===Explanation=== | |||
Before, it was only removing fall damage if the console variable was preventing it from doing it. Now, it will always deal no fall damage as it is always returning 0. | Before, it was only removing fall damage if the console variable was preventing it from doing it. Now, it will always deal no fall damage as it is always returning 0. | ||
[[Category:Programming]] | [[Category:Programming]] | ||
[[Category:Free source code]] | [[Category:Free source code]] |
Latest revision as of 12:14, 30 June 2025

This article has no
links to other VDC articles. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024


January 2024
Removing fall damage is a simple process in sp 2013, I have yet to try it in other versions, yet the principle should work across all versions.

Editing the code
Singleolayer 2013
- Find hl2_player.cpp in the server project in the Server(game)/Source Files\HL2 DLL\hl2_player.cpp or in the local file path of src/game/server/hl2/hl2_player.cpp
- Find the following if statement in the file (I found it on lines 2294-2303):
// ignore fall damage if instructed to do so by input if ( ( info.GetDamageType() & DMG_FALL ) && m_flTimeIgnoreFallDamage > gpGlobals->curtime ) { // usually, we will reset the input flag after the first impact. //However there is another input that // prevents this behavior. if ( m_bIgnoreFallDamageResetAfterImpact ) { m_flTimeIgnoreFallDamage = 0; } return 0; }
- Alter or comment the code to make it look like this:
// Always Ignore Fall Damage if ( info.GetDamageType() & DMG_FALL ) { return 0; }
Explanation
Before, it was only removing fall damage if the console variable was preventing it from doing it. Now, it will always deal no fall damage as it is always returning 0.