File: 0012-Minor-refactor-in-RecastMesh.cpp-661.patch

package info (click to toggle)
recastnavigation 1.6.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,928 kB
  • sloc: cpp: 50,116; ansic: 2,674; xml: 182; makefile: 16
file content (44 lines) | stat: -rw-r--r-- 1,447 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From cd898904b72a300011fbb24d578620bafa08ef2c Mon Sep 17 00:00:00 2001
From: Gamemechanic <stesve@gmail.com>
Date: Mon, 4 Sep 2023 16:53:41 +0200
Subject: [PATCH 12/36] Minor refactor in RecastMesh.cpp (#661)

---
 Recast/Source/RecastMesh.cpp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Recast/Source/RecastMesh.cpp b/Recast/Source/RecastMesh.cpp
index 390088c..c9eb60a 100644
--- a/Recast/Source/RecastMesh.cpp
+++ b/Recast/Source/RecastMesh.cpp
@@ -216,8 +216,8 @@ static bool between(const int* a, const int* b, const int* c)
 	// If ab not vertical, check betweenness on x; else on y.
 	if (a[0] != b[0])
 		return	((a[0] <= c[0]) && (c[0] <= b[0])) || ((a[0] >= c[0]) && (c[0] >= b[0]));
-	else
-		return	((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2]));
+
+	return	((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2]));
 }
 
 // Returns true iff segments ab and cd intersect, properly or improperly.
@@ -225,11 +225,12 @@ static bool intersect(const int* a, const int* b, const int* c, const int* d)
 {
 	if (intersectProp(a, b, c, d))
 		return true;
-	else if (between(a, b, c) || between(a, b, d) ||
-			 between(c, d, a) || between(c, d, b))
+
+	if (between(a, b, c) || between(a, b, d) ||
+		between(c, d, a) || between(c, d, b))
 		return true;
-	else
-		return false;
+	
+	return false;
 }
 
 static bool vequal(const int* a, const int* b)
-- 
2.43.0