commit bc7a775cbd1490a8a3fb8779f837be1ad316a005 parent 74d047d7eae558d25746bbe24a8c66c83f63587f Author: Michael Savage <mikejsavage@gmail.com> Date: Tue Aug 22 18:21:54 +0100 Initialise high_t to -1 so we don't use the (uninitialised!) high trace if we can't step up Diffstat:
hm.cc | | | 4 | +++- |
diff --git a/hm.cc b/hm.cc @@ -238,7 +238,9 @@ GAME_FRAME( game_frame ) { v3 high_end = high_start + game->velocity * remaining_t; float low_t; - float high_t; + // initialise high_t to -1 so we never pick the high trace + // if we couldn't step up (fails the high_t > low_t test) + float high_t = -1; v3 low_normal, high_normal; bool low_hit = segment_vs_terrain( &game->tm, low_start, low_end, &low_t, &low_normal );