mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Limit beams to one per entity.
Note that this is only a soft-limit and prevents excessive beams when only one is expected. If more beams are desirned, just use 0 for the entity number.
This commit is contained in:
parent
66ef8e16c1
commit
3519931b78
2 changed files with 26 additions and 10 deletions
|
@ -310,14 +310,22 @@ CL_ParseBeam (model_t *m)
|
|||
MSG_ReadCoordV (net_message, start);
|
||||
MSG_ReadCoordV (net_message, end);
|
||||
|
||||
to = new_tent_object ();
|
||||
to->next = cl_beams;
|
||||
cl_beams = to;
|
||||
to = 0;
|
||||
if (ent) {
|
||||
for (to = cl_beams; to; to = to->next)
|
||||
if (to->to.beam.entity == ent)
|
||||
break;
|
||||
}
|
||||
if (!to) {
|
||||
to = new_tent_object ();
|
||||
to->next = cl_beams;
|
||||
cl_beams = to;
|
||||
to->to.beam.tents = 0;
|
||||
to->to.beam.entity = ent;
|
||||
}
|
||||
b = &to->to.beam;
|
||||
b->tents = 0;
|
||||
|
||||
beam_clear (b);
|
||||
b->entity = ent;
|
||||
b->model = m;
|
||||
b->endtime = cl.time + 0.2;
|
||||
b->seed = rand ();
|
||||
|
|
|
@ -314,14 +314,22 @@ CL_ParseBeam (model_t *m)
|
|||
MSG_ReadCoordV (net_message, start);
|
||||
MSG_ReadCoordV (net_message, end);
|
||||
|
||||
to = new_tent_object ();
|
||||
to->next = cl_beams;
|
||||
cl_beams = to;
|
||||
to = 0;
|
||||
if (ent) {
|
||||
for (to = cl_beams; to; to = to->next)
|
||||
if (to->to.beam.entity == ent)
|
||||
break;
|
||||
}
|
||||
if (!to) {
|
||||
to = new_tent_object ();
|
||||
to->next = cl_beams;
|
||||
cl_beams = to;
|
||||
to->to.beam.tents = 0;
|
||||
to->to.beam.entity = ent;
|
||||
}
|
||||
b = &to->to.beam;
|
||||
b->tents = 0;
|
||||
|
||||
beam_clear (b);
|
||||
b->entity = ent;
|
||||
b->model = m;
|
||||
b->endtime = cl.time + 0.2;
|
||||
b->seed = rand ();
|
||||
|
|
Loading…
Reference in a new issue