X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cl_collision.c;h=513aa13ecb44bddf44054fa6e495904279ae0afc;hb=9e160a615b83477f8eec2ba38e16afff6ea9bac4;hp=e9fd16fcf0886e345d0e7116a8c61b7a156272c6;hpb=79d25017219944e264aadc7ab556c86d3955e4b2;p=xonotic%2Fdarkplaces.git diff --git a/cl_collision.c b/cl_collision.c index e9fd16fc..513aa13e 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -157,8 +157,8 @@ void CL_LinkEdict(prvm_edict_t *ent) if( model != NULL ) { - if (!model->TraceBox && developer.integer >= 1) - Con_Printf("edict %i: SOLID_BSP with non-collidable model\n", PRVM_NUM_FOR_EDICT(ent)); + if (!model->TraceBox) + Con_DPrintf("edict %i: SOLID_BSP with non-collidable model\n", PRVM_NUM_FOR_EDICT(ent)); if (ent->fields.client->angles[0] || ent->fields.client->angles[2] || ent->fields.client->avelocity[0] || ent->fields.client->avelocity[2]) { @@ -321,7 +321,7 @@ trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int vec3_t origin, entmins, entmaxs; matrix4x4_t entmatrix, entinversematrix; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit network players, if we are a nonsolid player if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616) @@ -340,7 +340,7 @@ trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int if (!cl.scores[i-1].name[0]) continue; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit spectators or nonsolid players if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616) @@ -463,7 +463,10 @@ trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ vec3_t end; vec_t len = 0; - if(!VectorCompare(start, pEnd) && collision_endposnudge.value > 0) + if (VectorCompare(start, pEnd)) + return CL_TracePoint(start, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities); + + if(collision_endposnudge.value > 0) { // TRICK: make the trace 1 qu longer! VectorSubtract(pEnd, start, end); @@ -472,10 +475,10 @@ trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ } else VectorCopy(pEnd, end); -#endif - +#else if (VectorCompare(start, end)) return CL_TracePoint(start, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities); +#endif if (hitnetworkentity) *hitnetworkentity = 0; @@ -551,7 +554,7 @@ trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ vec3_t origin, entmins, entmaxs; matrix4x4_t entmatrix, entinversematrix; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit network players, if we are a nonsolid player if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616) @@ -570,7 +573,7 @@ trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_ if (!cl.scores[i-1].name[0]) continue; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit spectators or nonsolid players if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616) @@ -701,6 +704,19 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co vec3_t end; vec_t len = 0; + if (VectorCompare(mins, maxs)) + { + vec3_t shiftstart, shiftend; + VectorAdd(start, mins, shiftstart); + VectorAdd(pEnd, mins, shiftend); + if (VectorCompare(start, pEnd)) + trace = CL_TracePoint(shiftstart, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities); + else + trace = CL_TraceLine(shiftstart, shiftend, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities); + VectorSubtract(trace.endpos, mins, trace.endpos); + return trace; + } + if(!VectorCompare(start, pEnd) && collision_endposnudge.value > 0) { // TRICK: make the trace 1 qu longer! @@ -710,8 +726,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co } else VectorCopy(pEnd, end); -#endif - +#else if (VectorCompare(mins, maxs)) { vec3_t shiftstart, shiftend; @@ -724,6 +739,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co VectorSubtract(trace.endpos, mins, trace.endpos); return trace; } +#endif if (hitnetworkentity) *hitnetworkentity = 0; @@ -812,7 +828,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co vec3_t origin, entmins, entmaxs; matrix4x4_t entmatrix, entinversematrix; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit network players, if we are a nonsolid player if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616) @@ -831,7 +847,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co if (!cl.scores[i-1].name[0]) continue; - if(gamemode == GAME_NEXUIZ) + if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) { // don't hit spectators or nonsolid players if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)