===============================================================================
| 1260 | |
| 1261 | //=============================================================================== |
| 1262 | qboolean G_CheckInSolid (gentity_t *self, qboolean fix) |
| 1263 | { |
| 1264 | trace_t trace; |
| 1265 | vec3_t end, mins; |
| 1266 | |
| 1267 | VectorCopy(self->currentOrigin, end); |
| 1268 | end[2] += self->mins[2]; |
| 1269 | VectorCopy(self->mins, mins); |
| 1270 | mins[2] = 0; |
| 1271 | |
| 1272 | gi.trace(&trace, self->currentOrigin, mins, self->maxs, end, self->s.number, self->clipmask, (EG2_Collision)0, 0); |
| 1273 | if(trace.allsolid || trace.startsolid) |
| 1274 | { |
| 1275 | return qtrue; |
| 1276 | } |
| 1277 | |
| 1278 | #ifdef _DEBUG |
| 1279 | if(trace.fraction < 0.99999713) |
| 1280 | #else |
| 1281 | if(trace.fraction < 1.0) |
| 1282 | #endif |
| 1283 | { |
| 1284 | if(fix) |
| 1285 | {//Put them at end of trace and check again |
| 1286 | vec3_t neworg; |
| 1287 | |
| 1288 | VectorCopy(trace.endpos, neworg); |
| 1289 | neworg[2] -= self->mins[2]; |
| 1290 | G_SetOrigin(self, neworg); |
| 1291 | gi.linkentity(self); |
| 1292 | |
| 1293 | return G_CheckInSolid(self, qfalse); |
| 1294 | } |
| 1295 | else |
| 1296 | { |
| 1297 | return qtrue; |
| 1298 | } |
| 1299 | } |
| 1300 | |
| 1301 | return qfalse; |
| 1302 | } |
| 1303 | |
| 1304 | qboolean infront(gentity_t *from, gentity_t *to) |
| 1305 | { |
no test coverage detected