diff --git a/code/botlib/be_aas_reach.c b/code/botlib/be_aas_reach.c index ed9ff76d..0520e2ce 100644 --- a/code/botlib/be_aas_reach.c +++ b/code/botlib/be_aas_reach.c @@ -2141,6 +2141,8 @@ int AAS_Reachability_Jump(int area1num, int area2num) if (area2->mins[2] > area1->maxs[2] + maxjumpheight) return qfalse; // bestdist = 999999; + memset(&beststart2, 0, sizeof(beststart2)); + memset(&bestend2,0,sizeof(bestend2)); // for (i = 0; i < area1->numfaces; i++) { @@ -3163,6 +3165,8 @@ aas_lreachability_t *AAS_FindFaceReachabilities(vec3_t *facepoints, int numpoint lreachabilities = NULL; bestfacenum = 0; bestfaceplane = NULL; + memset(&beststart2, 0, sizeof(beststart2)); + memset(&bestend2, 0 , sizeof(bestend2)); // for (i = 1; i < aasworld.numareas; i++) { diff --git a/code/renderer_oa/tr_shade_calc.c b/code/renderer_oa/tr_shade_calc.c index 270affb8..31236a56 100644 --- a/code/renderer_oa/tr_shade_calc.c +++ b/code/renderer_oa/tr_shade_calc.c @@ -1401,17 +1401,16 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st ) int frametotal = w * h; float alha = ((0.25+backEnd.currentEntity->e.shaderRGBA[3]) / (tr.identityLight * 256.0f)); int framethere = frametotal - ((frametotal * alha)); - int f; - framex = 0; - for(f=0; f= w){ - framey +=1; // next row! - framex = 0; // reset column - } + if (framex >= w){ + framey +=1; // next row! + framex = 0; // reset column } + } } else // static/animated @@ -1452,12 +1451,11 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st ) tmi.matrix[0][0] = 1.0f / w; tmi.matrix[1][0] = 0; - tmi.matrix[2][0] = 0; + tmi.matrix[0][1] = 0; tmi.translate[0] = ((1.0f / w) * framex); tmi.matrix[0][1] = 0; tmi.matrix[1][1] = 1.0f / h; - tmi.matrix[2][1] = 0; tmi.translate[1] = ((1.0f / h) * framey); RB_CalcTransformTexCoords( &tmi, st );