diff --git a/neo/d3xp/ai/AI_pathing.cpp b/neo/d3xp/ai/AI_pathing.cpp index 4b043dc5..a9825bda 100644 --- a/neo/d3xp/ai/AI_pathing.cpp +++ b/neo/d3xp/ai/AI_pathing.cpp @@ -155,7 +155,7 @@ GetPointOutsideObstacles void GetPointOutsideObstacles( const obstacle_t *obstacles, const int numObstacles, idVec2 &point, int *obstacle, int *edgeNum ) { int i, j, k, n, bestObstacle, bestEdgeNum, queueStart, queueEnd, edgeNums[2]; float d, bestd, scale[2]; - idVec3 plane, bestPlane; + idVec3 plane, bestPlane(0.0f, 0.0f, 0.0f); // DG: init it to shut up compiler idVec2 newPoint, dir, bestPoint; int *queue; bool *obstacleVisited; @@ -1128,7 +1128,8 @@ idAI::PredictPath */ bool idAI::PredictPath( const idEntity *ent, const idAAS *aas, const idVec3 &start, const idVec3 &velocity, int totalTime, int frameTime, int stopEvent, predictedPath_t &path ) { int i, j, step, numFrames, curFrameTime; - idVec3 delta, curStart, curEnd, curVelocity, lastEnd, stepUp, tmpStart; + idVec3 delta, curStart, curEnd, curVelocity, lastEnd, tmpStart; + idVec3 stepUp(0,0,0); // DG: init this to get rid of compiler warning idVec3 gravity, gravityDir, invGravityDir; float maxStepHeight, minFloorCos; pathTrace_t trace; @@ -1183,7 +1184,7 @@ bool idAI::PredictPath( const idEntity *ent, const idAAS *aas, const idVec3 &sta return true; } - if ( step ) { + if ( step != 0 ) { // step down at end point tmpStart = trace.endPos; diff --git a/neo/game/ai/AI_pathing.cpp b/neo/game/ai/AI_pathing.cpp index 9c961a9c..8c19de33 100644 --- a/neo/game/ai/AI_pathing.cpp +++ b/neo/game/ai/AI_pathing.cpp @@ -157,7 +157,7 @@ GetPointOutsideObstacles void GetPointOutsideObstacles( const obstacle_t *obstacles, const int numObstacles, idVec2 &point, int *obstacle, int *edgeNum ) { int i, j, k, n, bestObstacle, bestEdgeNum, queueStart, queueEnd, edgeNums[2]; float d, bestd, scale[2]; - idVec3 plane, bestPlane; + idVec3 plane, bestPlane(0.0f, 0.0f, 0.0f); // DG: init it to shut up compiler idVec2 newPoint, dir, bestPoint; int *queue; bool *obstacleVisited; @@ -1131,7 +1131,8 @@ idAI::PredictPath */ bool idAI::PredictPath( const idEntity *ent, const idAAS *aas, const idVec3 &start, const idVec3 &velocity, int totalTime, int frameTime, int stopEvent, predictedPath_t &path ) { int i, j, step, numFrames, curFrameTime; - idVec3 delta, curStart, curEnd, curVelocity, lastEnd, stepUp, tmpStart; + idVec3 delta, curStart, curEnd, curVelocity, lastEnd, tmpStart; + idVec3 stepUp(0,0,0); // DG: init this to get rid of compiler warning idVec3 gravity, gravityDir, invGravityDir; float maxStepHeight, minFloorCos; pathTrace_t trace; diff --git a/neo/renderer/tr_light.cpp b/neo/renderer/tr_light.cpp index 59e4dfb3..24cb9da2 100644 --- a/neo/renderer/tr_light.cpp +++ b/neo/renderer/tr_light.cpp @@ -1062,12 +1062,6 @@ R_IssueEntityDefCallback */ bool R_IssueEntityDefCallback( idRenderEntityLocal *def ) { bool update; - idBounds oldBounds; - const bool checkBounds = r_checkBounds.GetBool(); - - if ( checkBounds ) { - oldBounds = def->referenceBounds; - } def->archived = false; // will need to be written to the demo file tr.pc.c_entityDefCallbacks++; @@ -1082,7 +1076,10 @@ bool R_IssueEntityDefCallback( idRenderEntityLocal *def ) { return false; } - if ( checkBounds ) { + // DG: moved some code down here so all the boundchecking stuff is in the same if (because why not) + // (also works around yet another GCC maybe-uninitialized false positive) + if ( r_checkBounds.GetBool() ) { + idBounds oldBounds = def->referenceBounds; if ( oldBounds[0][0] > def->referenceBounds[0][0] + CHECK_BOUNDS_EPSILON || oldBounds[0][1] > def->referenceBounds[0][1] + CHECK_BOUNDS_EPSILON || oldBounds[0][2] > def->referenceBounds[0][2] + CHECK_BOUNDS_EPSILON ||