[HL2MP] Fix trigger_push not lifting players off the ground
Issue:
When a trigger_push is set to push players upwards, they often remain stuck to the ground and are not properly lifted when in motion (moving about). The original 1-unit Z-axis push is insufficient to "unglue" moving players from the floor.
Fix: Change the 1-unit Z push to 16. It might be overkill, but it at least ensures that players get pushed upwards when inside an active volume.
This will breaks maps that expect the old behavior. I can remember maps which had a corridor where you could proceed ahead or optionally choose to jump to use the trigger push instead. If you want to force players off the ground there was already workarounds available (such as addoutput basevelocity)
~~I'd advise maybe adding a convar (that's off by default) that enables or disables this behavior~~
i.e
ConVar sv_trigger_push_useoriginfix("sv_trigger_push_useoriginfix", "0", FCVAR_NOTIFY);
...
if (sv_trigger_push_useoriginfix.GetBool())
{
origin.z += 16.0f;
}
else
{
origin.z += 1.0f;
}
EDIT: actually, make this a Keyfield so it can be used in Hammer.
bool m_bFixLift;
...
DEFINE_KEYFIELD(m_bFixLift, FIELD_BOOLEAN, "liftfix"),
...
if (m_bFixLift)
{
origin.z += 16.0f;
}
else
{
origin.z += 1.0f;
}