1
0
Fork 0
forked from fte/fteqw

Bugfixes #16 and #17

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2733 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Molgrum 2007-10-10 18:01:27 +00:00
parent 5a627ccb8e
commit 9b80f13f2e

View file

@ -1918,6 +1918,7 @@ viewer_t *GetCommentator(viewer_t *v)
void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg) void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
{ {
bsp_t *bsp = (!tv || tv->controller == v ? NULL : tv->bsp);
viewer_t *cv; viewer_t *cv;
packet_entities_t *e; packet_entities_t *e;
int i; int i;
@ -1946,7 +1947,7 @@ void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
v->settime = tv->physicstime; v->settime = tv->physicstime;
} }
BSP_SetupForPosition(tv->bsp, v->origin[0], v->origin[1], v->origin[2]); BSP_SetupForPosition(bsp, v->origin[0], v->origin[1], v->origin[2]);
lerp = ((tv->simtime - tv->oldpackettime)/1000.0f) / ((tv->nextpackettime - tv->oldpackettime)/1000.0f); lerp = ((tv->simtime - tv->oldpackettime)/1000.0f) / ((tv->nextpackettime - tv->oldpackettime)/1000.0f);
if (lerp < 0) if (lerp < 0)
@ -1995,7 +1996,7 @@ void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
continue; continue;
//bsp cull. currently tracked player is always visible //bsp cull. currently tracked player is always visible
if (track != i && !BSP_Visible(tv->bsp, tv->players[i].leafcount, tv->players[i].leafs)) if (track != i && !BSP_Visible(bsp, tv->players[i].leafcount, tv->players[i].leafs))
continue; continue;
flags = PF_COMMAND; flags = PF_COMMAND;
@ -2117,7 +2118,7 @@ void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
//pvs cull everything else //pvs cull everything else
newstate = &topacket->ents[newindex]; newstate = &topacket->ents[newindex];
newnum = topacket->entnums[newindex]; newnum = topacket->entnums[newindex];
if (newstate->modelindex >= tv->numinlines && !BSP_Visible(tv->bsp, tv->entity[newnum].leafcount, tv->entity[newnum].leafs)) if (newstate->modelindex >= tv->numinlines && !BSP_Visible(bsp, tv->entity[newnum].leafcount, tv->entity[newnum].leafs))
continue; continue;
e->entnum[e->numents] = newnum; e->entnum[e->numents] = newnum;
@ -3125,6 +3126,13 @@ void QTV_Say(cluster_t *cluster, sv_t *qtv, viewer_t *v, char *message, qboolean
if (v->server) if (v->server)
SV_SayToUpstream(v->server, message); SV_SayToUpstream(v->server, message);
// If the currect viewer is the player, pass on the say_team
if (qtv && qtv->controller == v)
{
SendClientCommand(qtv, "say_team %s", message);
return;
}
for (ov = cluster->viewers; ov; ov = ov->next) for (ov = cluster->viewers; ov; ov = ov->next)
{ {
if (ov->server != v->server) if (ov->server != v->server)