Skip to content

Commit

Permalink
Remove invalid assert condition
Browse files Browse the repository at this point in the history
  • Loading branch information
vsonnier committed Jul 20, 2024
1 parent 9e3cfe2 commit 72ad715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Quake/pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,14 +782,14 @@ void ED_Write (FILE *f, edict_t *ed)
{
d = &qcvm->fielddefs[i];
type = d->type;
assert (!!(type & DEF_SAVEGLOBAL) == (strlen (PR_GetString (d->s_name)) > 1 && PR_GetString (d->s_name)[strlen (PR_GetString (d->s_name)) - 2] == '_'));
// exclude tagged DEF_SAVEGLOBAL, which are saved by the dedicated ED_WriteGlobals()
if (type & DEF_SAVEGLOBAL)
continue;

v = (int *)((char *)&ed->v + d->ofs * 4);

// if the value is still all 0, skip the field
assert (type < 8 && ((type == ev_vector && type_size[type] == 3) || (type != ev_vector && type_size[type] == 1)));
assert (type < NUM_TYPE_SIZES && ((type == ev_vector && type_size[type] == 3) || (type != ev_vector && type_size[type] == 1)));
if (type != ev_vector && !v[0])
continue;
if (type == ev_vector && !v[0] && !v[1] && !v[2])
Expand Down

0 comments on commit 72ad715

Please sign in to comment.