From: bones_was_here Date: Mon, 30 Jan 2023 21:21:25 +0000 (+1000) Subject: Fix GCC 12 warns: comparison will always evaluate as true X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=631fe708fe21b1d826f6b3e4fe31158c104d2937;p=xonotic%2Fdarkplaces.git Fix GCC 12 warns: comparison will always evaluate as true Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/55 Signed-off-by: bones_was_here --- diff --git a/cl_collision.c b/cl_collision.c index 97303e7a..ad6e5600 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -978,7 +978,7 @@ trace_t CL_Cache_TraceLineSurfaces(const vec3_t start, const vec3_t end, int typ if (!model) continue; // animated models are not suitable for caching - if ((&touch->priv.server->frameblend[0] && (touch->priv.server->frameblend[0].lerp != 1.0 || touch->priv.server->frameblend[0].subframe != 0)) || touch->priv.server->skeleton.relativetransforms) + if ((touch->priv.server->frameblend[0].lerp != 1.0 || touch->priv.server->frameblend[0].subframe != 0) || touch->priv.server->skeleton.relativetransforms) continue; if (type == MOVE_NOMONSTERS && PRVM_clientedictfloat(touch, solid) != SOLID_BSP) continue; diff --git a/sbar.c b/sbar.c index 687c9499..854c62a6 100644 --- a/sbar.c +++ b/sbar.c @@ -1214,7 +1214,7 @@ void Sbar_ShowFPS(void) svtrace.fraction = 2.0; cltrace.fraction = 2.0; // ray hits models (even animated ones) and ignores translucent materials - if (SVVM_prog != NULL) + if (sv.active) svtrace = SV_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value); cltrace = CL_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value, true, false, &hitnetentity, true, true); if (cltrace.hittexture) @@ -1234,7 +1234,7 @@ void Sbar_ShowFPS(void) } else { - if (CLVM_prog != NULL && cltrace.ent != NULL) + if (cltrace.ent != NULL) { prvm_prog_t *prog = CLVM_prog; dpsnprintf(entstring, sizeof(entstring), "client entity %i", (int)PRVM_EDICT_TO_PROG(cltrace.ent));