X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=world.c;h=764023a279812ffac6875f7a21d44aab39bc2602;hb=069527b0cff9d91784bba159329e01b0b94df752;hp=64a762943a029dfabb2437e05432932ba00ad811;hpb=82f69d1a89085e7036f3d9524ac721b19698ec9e;p=xonotic%2Fdarkplaces.git diff --git a/world.c b/world.c index 64a76294..764023a2 100644 --- a/world.c +++ b/world.c @@ -45,9 +45,9 @@ void InsertLinkAfter (link_t *l, link_t *after); // (type *)STRUCT_FROM_LINK(link_t *link, type, member) // ent = STRUCT_FROM_LINK(link,entity_t,order) // FIXME: remove this mess! -//#define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m))) +//#define STRUCT_FROM_LINK(l,t,m) ((t *)((qbyte *)l - (int)&(((t *)0)->m))) -#define EDICT_FROM_AREA(l) ((edict_t *)((byte *)l - (int)&(((edict_t *)0)->area))) +#define EDICT_FROM_AREA(l) ((edict_t *)((qbyte *)l - (int)&(((edict_t *)0)->area))) //============================================================================ @@ -137,7 +137,7 @@ void SV_InitBoxHull (void) box_planes[i].type = i>>1; box_planes[i].normal[i>>1] = 1; } - + } @@ -803,7 +803,7 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max VectorAdd (trace.endpos, offset, trace.endpos); trace.ent = ent; } - else if (trace.startsolid) + else if (trace.allsolid || trace.startsolid) trace.ent = ent; return trace; @@ -824,9 +824,9 @@ void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip ) edict_t *touch; trace_t trace; +loc0: if (clip->trace.allsolid) return; -loc0: // touch linked edicts for (l = node->solid_edicts.next ; l != &node->solid_edicts ; l = next) { @@ -870,10 +870,14 @@ loc0: trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end); else trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins, clip->maxs, clip->end); - if (trace.allsolid || trace.startsolid || trace.fraction < clip->trace.fraction) + if (trace.allsolid) { - trace.ent = touch; - if (clip->trace.startsolid) + clip->trace = trace; + return; + } + if (trace.startsolid || trace.fraction < clip->trace.fraction) + { + if (clip->trace.startsolid) { clip->trace = trace; clip->trace.startsolid = true; @@ -881,8 +885,6 @@ loc0: else clip->trace = trace; } - if (clip->trace.allsolid) - return; } // recurse down both sides