CalcPoints: if NearWall() fails, first try fudging by 0.25 units in each direction

This commit is contained in:
Eric Wasylishen 2016-02-11 23:30:21 -07:00
parent a439f891a1
commit 651e7ca827
1 changed files with 15 additions and 0 deletions

View File

@ -523,6 +523,21 @@ CalcPoints(const dmodel_t *model, const vec3_t offset, const texorg_t *texorg, l
if (!NearWall(point))
continue; // all good
// First try fudging by 0.25
bool good = false;
for (i = 0; i < 6; i++) {
vec3_t testpoint;
VectorCopy(point, testpoint);
testpoint[i/2] += (i%2) ? 0.25 : -0.25;
if (!NearWall(testpoint)) {
VectorCopy(testpoint, point);
good = true;
}
}
if (good)
continue;
// Next try a trace
for (i = 0; i < 6; i++) {
const int flags = TRACE_HIT_SOLID;
tracepoint_t hit;