Skip to content

Commit

Permalink
Fixed|Client: Clear view color filter when connecting
Browse files Browse the repository at this point in the history
An old view filter may remain from an earlier client session.
  • Loading branch information
skyjake committed Mar 16, 2013
1 parent 30d4d46 commit cdf0a67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion doomsday/api/api_player.h
Expand Up @@ -56,7 +56,6 @@ typedef enum controltype_e {
* @{
*/
#define DDPF_FIXANGLES 0x0001 ///< Server: send angle/pitch to client.
//#define DDPF_FILTER 0x0002 // Server: send filter to client.
#define DDPF_FIXORIGIN 0x0004 ///< Server: send coords to client.
#define DDPF_DEAD 0x0008 ///< Cl & Sv: player is dead.
#define DDPF_CAMERA 0x0010 ///< Player is a cameraman.
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/client/cl_main.cpp
Expand Up @@ -185,6 +185,7 @@ void Cl_AnswerHandshake(void)
ddPlayers[consolePlayer].shared.flags |= DDPF_LOCAL;

Smoother_Clear(clients[consolePlayer].smoother);
ddPlayers[consolePlayer].shared.flags &= ~DDPF_USE_VIEW_FILTER;

isClient = true;
isServer = false;
Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/common/src/g_game.c
Expand Up @@ -1936,7 +1936,6 @@ void G_PlayerLeaveMap(int player)

// Clear filter.
p->plr->flags &= ~DDPF_VIEW_FILTER;
//p->plr->flags |= DDPF_FILTER; // Server: Send the change to the client.
p->damageCount = 0; // No palette changes.
p->bonusCount = 0;

Expand Down
23 changes: 12 additions & 11 deletions doomsday/server/src/server/sv_main.cpp
Expand Up @@ -37,6 +37,7 @@

#include <de/ArrayValue>
#include <de/NumberValue>
#include <de/Log>

// This is absolute maximum bandwidth rating. Frame size is practically
// unlimited with this score.
Expand Down Expand Up @@ -580,19 +581,18 @@ void Sv_GetPackets(void)
*/
boolean Sv_PlayerArrives(unsigned int nodeID, char const *name)
{
int i;

Con_Message("Sv_PlayerArrives: '%s' has arrived.", name);
LOG_AS("Sv_PlayerArrives");
LOG_INFO("'%s' has arrived.") << name;

// We need to find the new player a client entry.
for(i = 1; i < DDMAXPLAYERS; ++i)
for(int i = 1; i < DDMAXPLAYERS; ++i)
{
client_t *cl = &clients[i];
client_t *cl = &clients[i];

if(!cl->connected)
{
player_t *plr = &ddPlayers[i];
ddplayer_t *ddpl = &plr->shared;
player_t *plr = &ddPlayers[i];
ddplayer_t *ddpl = &plr->shared;

// This'll do.
cl->connected = true;
Expand All @@ -606,18 +606,19 @@ boolean Sv_PlayerArrives(unsigned int nodeID, char const *name)
ddpl->fixAcked.origin =
ddpl->fixAcked.mom = -1;

// Clear the view filter.
memset(ddpl->filterColor, 0, sizeof(ddpl->filterColor));
ddpl->flags &= ~DDPF_VIEW_FILTER;

Sv_InitPoolForClient(i);
Smoother_Clear(cl->smoother);

VERBOSE(Con_Printf
("Sv_PlayerArrives: '%s' assigned to "
"console %i (node: %x)\n", cl->name, i, nodeID));
LOG_VERBOSE("'%s' assigned to console %i (node:%u)") << cl->name << i << nodeID;

// In order to get in the game, the client must first
// shake hands. It'll request this by sending a Hello packet.
// We'll be waiting...
cl->handshake = false;
//cl->updateCount = UPDATECOUNT;
return true;
}
}
Expand Down

0 comments on commit cdf0a67

Please sign in to comment.