commit 1134129bf85d766ed004c1cc6d7ec914c85adc62
Author: Alexandre-Xavier Labonté-Lamoureux <alexandrexavier@live.ca>
AuthorDate: Mon Aug 6 21:03:16 2018 -0400
Commit: Alexandre-Xavier Labonté-Lamoureux <alexandrexavier@live.ca>
CommitDate: Mon Aug 6 21:03:16 2018 -0400
Heretic: Fix P_FindNextHighestFloor's behavior
The floor would raise to INT_MAX if no surrounding sector was higher, which isn't how vanilla Heretic behaves.
---
src/heretic/p_spec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/heretic/p_spec.c b/src/heretic/p_spec.c
index 03bec111..852fa619 100644
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -424,6 +424,13 @@ fixed_t P_FindNextHighestFloor(sector_t * sec, int currentheight)
}
}
+ // Don't return INT_MAX if no higher floor is found.
+
+ if (!h)
+ {
+ return height;
+ }
+
// Compatibility note, in case of demo desyncs.
if (h > 20)