Skip to content

Commit

Permalink
Fix field by index lookup
Browse files Browse the repository at this point in the history
Field at index zero is an invalid field with offset set to 0
Field at index one is a valid field (modelindex) with offset set to 0 as well
Field by index lookup should start with one, modelindex field would never be picked otherwise
  • Loading branch information
alexey-lysiuk committed Sep 28, 2024
1 parent debadb6 commit fe459b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Quake/pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static ddef_t *ED_FieldAtOfs (int ofs)
ddef_t *def;
int i;

for (i = 0; i < progs->numfielddefs; i++)
for (i = 1; i < progs->numfielddefs; i++)
{
def = &pr_fielddefs[i];
if (def->ofs == ofs)
Expand Down

0 comments on commit fe459b4

Please sign in to comment.