Skip to content

Commit

Permalink
Merge pull request #997 from qw-ctf/fix-baselines
Browse files Browse the repository at this point in the history
PROTOCOL: Fix baselines for trans & colourmod.
  • Loading branch information
dsvensson authored Jan 14, 2025
2 parents fb445b3 + e9b108f commit 725c563
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,15 @@ void CL_ParseBaseline (entity_state_t *es)
es->origin[i] = MSG_ReadCoord ();
es->angles[i] = MSG_ReadAngle ();
}

#ifdef FTE_PEXT_TRANS
es->trans = 0;
#endif
#ifdef FTE_PEXT_COLOURMOD
es->colourmod[0] = 0;
es->colourmod[1] = 0;
es->colourmod[2] = 0;
#endif
}

// An easy way to keep compatability with other entity extensions
Expand Down
10 changes: 10 additions & 0 deletions src/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ static void SV_CreateBaseline (void)
svent->e.baseline.colormap = 0;
svent->e.baseline.modelindex = svent->v->modelindex;
}

#ifdef FTE_PEXT_TRANS
svent->e.baseline.trans = svent->xv.alpha >= 1.0f ? 0 : bound(0, (byte)(svent->xv.alpha * 254.0), 254);
#endif
#ifdef FTE_PEXT_COLOURMOD
svent->e.baseline.colourmod[0] = bound(0, svent->xv.colourmod[0] * (256.0f / 8.0f), 255);
svent->e.baseline.colourmod[1] = bound(0, svent->xv.colourmod[1] * (256.0f / 8.0f), 255);
svent->e.baseline.colourmod[2] = bound(0, svent->xv.colourmod[2] * (256.0f / 8.0f), 255);
#endif

}
sv.num_baseline_edicts = sv.num_edicts;
}
Expand Down

0 comments on commit 725c563

Please sign in to comment.