CalcPoints: if NearWall() fails, first try fudging by 0.25 units in each direction
This commit is contained in:
parent
a439f891a1
commit
651e7ca827
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue