Skip to content

Commit

Permalink
Make sure scales are initialized to ENTSCALE_DEFAULT
Browse files Browse the repository at this point in the history
  • Loading branch information
temx authored and sezero committed Sep 5, 2022
1 parent 947c782 commit 6bff956
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Quake/cl_parse.c
Expand Up @@ -126,6 +126,7 @@ entity_t *CL_EntityNum (int num)
{
cl_entities[cl.num_entities].colormap = vid.colormap;
cl_entities[cl.num_entities].lerpflags |= LERP_RESETMOVE|LERP_RESETANIM; //johnfitz
cl_entities[cl.num_entities].baseline.scale = ENTSCALE_DEFAULT;
cl.num_entities++;
}
}
Expand Down Expand Up @@ -622,7 +623,7 @@ void CL_ParseUpdate (int bits)
}
else
ent->alpha = ent->baseline.alpha;
ent->scale = ENTSCALE_DEFAULT;
ent->scale = ent->baseline.scale;
}
//johnfitz

Expand Down
1 change: 1 addition & 0 deletions Quake/host_cmd.c
Expand Up @@ -1239,6 +1239,7 @@ static void Host_Loadgame_f (void)
}
else {
memset (ent, 0, pr_edict_size);
ent->baseline.scale = ENTSCALE_DEFAULT;
}
data = ED_ParseEdict (data, ent);

Expand Down
2 changes: 2 additions & 0 deletions Quake/pr_edict.c
Expand Up @@ -131,6 +131,7 @@ edict_t *ED_Alloc (void)
sv.num_edicts++;
e = EDICT_NUM(i);
memset(e, 0, pr_edict_size); // ericw -- switched sv.edicts to malloc(), so we are accessing uninitialized memory and must fully zero it, not just ED_ClearEdict
e->baseline.scale = ENTSCALE_DEFAULT;

return e;
}
Expand Down Expand Up @@ -159,6 +160,7 @@ void ED_Free (edict_t *ed)
ed->v.nextthink = -1;
ed->v.solid = 0;
ed->alpha = ENTALPHA_DEFAULT; //johnfitz -- reset alpha for next entity
ed->scale = ENTSCALE_DEFAULT;

ed->freetime = sv.time;
}
Expand Down
2 changes: 1 addition & 1 deletion Quake/sv_main.c
Expand Up @@ -1247,7 +1247,7 @@ void SV_CreateBaseline (void)
svent->baseline.colormap = 0;
svent->baseline.modelindex = SV_ModelIndex(PR_GetString(svent->v.model));
svent->baseline.alpha = svent->alpha; //johnfitz -- alpha support
svent->baseline.scale = svent->scale;
svent->baseline.scale = ENTSCALE_DEFAULT;
}

//johnfitz -- PROTOCOL_FITZQUAKE
Expand Down

0 comments on commit 6bff956

Please sign in to comment.