Ze-Rax / TrackmaniaFlagRush

FlagRush is the new community made, teambased gamemode for Trackmania2020, providing a completely new way to play your favourite racing game with direct player interaction. In FlagRush, two teams fight for a flag and try to bring it to the base of the opposing team to score a point while preventing the other team to do the same.
MIT License
15 stars 1 forks source link

Div by zero in FlagMarker #284

Closed Ze-Rax closed 8 months ago

Ze-Rax commented 8 months ago

Error:

ERROR [101, 50] Division by zero
 FlagRush_FlagMarker ()::Lerp01() [101, 50]
 FlagRush_FlagMarker ()::Lerp01() [106, 67]
 FlagRush_FlagMarker ()::UpdateLock() [202, 120]
 FlagRush_FlagMarker ()::Main() [232, 15]

Context:

Real Lerp01(Real _From, Real _To, Real _T) {
    declare Real Lerp = (_T - _From) / (_To - _From); // Div by zero possible here
    return ML::Clamp(Lerp, 0.0, 1.0);
}