Skip to content

Commit

Permalink
fix console message flags of renames/leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Feb 25, 2021
1 parent 2e272df commit 9e3d75a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions patches/zenmode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Index: src/fpsgame/client.cpp
{
if(strcmp(d->name, text) && !isignored(d->clientnum))
- conoutf("%s is now known as %s", colorname(d), colorname(d, text));
+ conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "%s is now known as %s", colorname(d), colorname(d, text));
+ conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
}
else // new client
{
Expand All @@ -115,7 +115,7 @@ Index: src/fpsgame/client.cpp
if(strcmp(text, d->name))
{
- if(!isignored(d->clientnum)) conoutf("%s is now known as %s", colorname(d), colorname(d, text));
+ if(!isignored(d->clientnum)) conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "%s is now known as %s", colorname(d), colorname(d, text));
+ if(!isignored(d->clientnum)) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
copystring(d->name, text, MAXNAMELEN+1);
}
}
Expand All @@ -137,7 +137,7 @@ Index: src/fpsgame/fps.cpp
fpsent *d = clients[cn];
if(!d) return;
- if(notify && d->name[0]) conoutf("\f4leave:\f7 %s", colorname(d));
+ if(notify && d->name[0]) conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "\f4leave:\f7 %s", colorname(d));
+ if(notify && d->name[0]) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "\f4leave:\f7 %s", colorname(d));
removeweapons(d);
removetrackedparticles(d);
removetrackeddynlights(d);
Expand Down
4 changes: 2 additions & 2 deletions src/fpsgame/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ namespace game
if(d->name[0]) // already connected
{
if(strcmp(d->name, text) && !isignored(d->clientnum))
conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "%s is now known as %s", colorname(d), colorname(d, text));
conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
}
else // new client
{
Expand All @@ -1475,7 +1475,7 @@ namespace game
if(!text[0]) copystring(text, "unnamed");
if(strcmp(text, d->name))
{
if(!isignored(d->clientnum)) conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "%s is now known as %s", colorname(d), colorname(d, text));
if(!isignored(d->clientnum)) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
copystring(d->name, text, MAXNAMELEN+1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/fpsgame/fps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ namespace game
unignore(cn);
fpsent *d = clients[cn];
if(!d) return;
if(notify && d->name[0]) conoutf(d->state==CS_SPECTATOR ? CON_INFO|CON_NONZEN : 0, "\f4leave:\f7 %s", colorname(d));
if(notify && d->name[0]) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "\f4leave:\f7 %s", colorname(d));
removeweapons(d);
removetrackedparticles(d);
removetrackeddynlights(d);
Expand Down

0 comments on commit 9e3d75a

Please sign in to comment.