#2879 closed defect (fixed)
[PATCH] Errors upon spectators using team chat.
Reported by: | scythetwirler | Owned by: | trompetin17 |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 18 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
Spectators using team chat will trigger errors on the actual players screens, but not the spectators.
Attachments (2)
Change History (13)
comment:1 by , 10 years ago
Keywords: | simple added |
---|
comment:2 by , 9 years ago
comment:4 by , 9 years ago
does Spectators use a team chat? even if you can use, who is going to recieve, because a spectator doesn't have a team, does it?
btw Im guessing the problem happen here
if (g_Players[Engine.GetPlayerID()].team != g_Players[sender].team)
can Spectators use chat?
Replying to leper:
How can hiding errors ever be a sensible solution?
by , 9 years ago
comment:5 by , 9 years ago
Keywords: | review patch added |
---|---|
Milestone: | Backlog → Alpha 18 |
Owner: | set to |
Summary: | Errors upon spectators using team chat. → [PATCH] Errors upon spectators using team chat. |
Observers only can use chat for global messages("message" or "/all message").
- TeamChat toggle is hidden to observer
follow-up: 7 comment:6 by , 9 years ago
Hi trompetin, the patch looks fine, however I don't like much the usage of your helper function without parameter (hideTeamOptionToObserver();
).
If you want to make the parameter "optional" you should check for it in the function to avoid strange behavior.
Also, as the function does not only hide the team to observers, but also toggles the checkbox, you should rename the function to something more general like updateTeamCheckbox
.
Thanks for working on this!
by , 9 years ago
Attachment: | 2879.2.diff added |
---|
comment:7 by , 9 years ago
Done :)
Replying to Itms:
Hi trompetin, the patch looks fine, however I don't like much the usage of your helper function without parameter (
hideTeamOptionToObserver();
). If you want to make the parameter "optional" you should check for it in the function to avoid strange behavior.Also, as the function does not only hide the team to observers, but also toggles the checkbox, you should rename the function to something more general like
updateTeamCheckbox
.Thanks for working on this!
comment:9 by , 9 years ago
I committed the patch with slight changes:
- used let instead of var in updateTeamCheckbox
- instead of handling the case where the parameter is undefined, I called the function with the parameter set to false
- I added a comment in messages.js for clarity
Thanks for fixing the issue!
comment:10 by , 9 years ago
Keywords: | simple review patch removed |
---|
So the idea is to get the errors to show up for the spectators or to remove the errors?