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:
Bill Currie 2012-07-06 08:29:21 +09:00
parent 66ef8e16c1
commit 3519931b78
2 changed files with 26 additions and 10 deletions

View file

@ -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 ();

View file

@ -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 ();