mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: minor improvement to traverse link selection algorithm
Slight optimization to skip unsupported ones out before computing anything, and also improves the generation results as we try to get the best one out of the supported ones, instead of taking one from supported and unsupported and then later check if its unsupported. (if the best type is 9, and 9 isn't supported while 8 is, and 8 would've been the candidate after 9, then this patch will still give the link a chance for 8 while the previous implementation would've skipped it entirely and returned DT_NULL_TRAVERSE_TYPE, ultimately resulting in no link whatsoever.
This commit is contained in:
parent
0814efe613
commit
7739a6c909
@ -498,6 +498,9 @@ unsigned char GetBestTraverseType(void* userData, const float traverseDist, cons
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!traverseTypeSupported(userData, (unsigned char)i))
|
||||
continue;
|
||||
|
||||
if (traverseDist < traverseType.minDist ||
|
||||
traverseDist > traverseType.maxDist)
|
||||
{
|
||||
@ -543,9 +546,6 @@ unsigned char GetBestTraverseType(void* userData, const float traverseDist, cons
|
||||
}
|
||||
}
|
||||
|
||||
if (!traverseTypeSupported(userData, (unsigned char)bestTraverseType))
|
||||
return DT_NULL_TRAVERSE_TYPE;
|
||||
|
||||
return (unsigned char)bestTraverseType;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user