You can throw a grenade through the ceiling
If you hold +duck in jump and throw a grenade in front of the ceiling
Example: https://youtu.be/s5QwPoEpSy0?t=32
This all comes to mappers
This all comes to mappers
right, not the game beign old, at all.
A simple fix would be to perform a trace from player view origin in the throw direction and clamping the grenade spawn position so it doesn't end up on the other side of walls.
The position seems to be this:
Vector vecStart = gpGlobals->v_forward * 16.0 + m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs;
The simple solution would be to replace 16 with 16 * trace.flFraction, which clamps the position to the original position or closer if something is blocking the throw. To avoid spawning grenades in walls you could subtract a little if fraction is not 1:
Vector vecSubtract = g_vecZero;
if( trace.flFraction != 1 && trace.flFraction != 0 )
{
vecSubtract = gpGlobals->v_forward * 0.1;
}
Vector vecStart = gpGlobals->v_forward * ( 16.0 * trace.flFraction) - vecSubtract + m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs;
Subtracting a fixed amount of units produces consistent results. Substracting should probably not be done if fraction is 0 (player stuck in wall/floor/ceiling?), maybe cancelling the throw would be better in this case.