]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix GCC 12 warns: comparison will always evaluate as true
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 30 Jan 2023 21:21:25 +0000 (07:21 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 30 Jan 2023 21:21:25 +0000 (07:21 +1000)
Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/55

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_collision.c
sbar.c

index 97303e7a92a9775678e2b5b5c7eefaaeba384cb2..ad6e560080465835819e577095bbf67b4a54f45e 100644 (file)
@@ -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 687c9499bd23dc0909f05237e48ffa5e18b641dd..854c62a683e656bc01709e7a1c063e0d02f5679f 100644 (file)
--- 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));