You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Only update if delta time is non-zero. It's zero if we're not moving at all (usually because we have no target).if (m_dTime != 0)
{
float scale = 1.0 / m_dTime;
float f = UTIL_SplineFraction(t * scale, 1.0);
Vector pos = (m_pos1 + m_vel1 * t) * (1.0 - f) + (m_pos2 - m_vel2 * (m_dTime - t)) * f;
Vector ang = (m_ang1) * (1.0 - f) + (m_ang2)*f;
m_velocity = m_vel1 * (1.0 - f) + m_vel2 * f;
UTIL_SetOrigin(pev, pos);
pev->angles = ang;
}
This change disables the movement update logic if the time between movement positions is zero. This value is zero if the Osprey isn't moving at all, such as when it has no target or when its speed is 0. It causes the scale variable to become infinity and the calculated vectors to become not-a-number (NaN) values which results in the Osprey moving to the world origin.
This also applies to the Black Ops Osprey in Opposing Force.
The text was updated successfully, but these errors were encountered:
If a
monster_osprey
isn't moving at all it will teleport to the world origin due to a divide by zero error.Change this:
halflife/dlls/osprey.cpp
Lines 415 to 424 in c7240b9
To this:
This change disables the movement update logic if the time between movement positions is zero. This value is zero if the Osprey isn't moving at all, such as when it has no target or when its speed is 0. It causes the
scale
variable to become infinity and the calculated vectors to become not-a-number (NaN) values which results in the Osprey moving to the world origin.This also applies to the Black Ops Osprey in Opposing Force.
The text was updated successfully, but these errors were encountered: