summaryrefslogtreecommitdiff
path: root/src/protocol/bahamut.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/bahamut.c')
-rw-r--r--src/protocol/bahamut.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index 3cc213a7c..0d6075c22 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -155,11 +155,15 @@ void bahamut_set_umode(User * user, int ac, char **av)
while (*modes) {
- add ? (user->mode |= umodes[(int) *modes]) : (user->mode &=
- ~umodes[(int)
- *modes]);
-
- switch (*modes++) {
+ /* This looks better, much better than "add ? (do_add) : (do_remove)".
+ * At least this is readable without paying much attention :) -GD
+ */
+ if (add)
+ user->mode |= umodes[(int) *modes];
+ else
+ user->mode &= ~umodes[(int) *modes];
+
+ switch (*modes++) {
case '+':
add = 1;
break;
@@ -1276,15 +1280,11 @@ void bahamut_cmd_quit(char *source, char *buf)
int anope_event_away(char *source, int ac, char **av)
{
- if (ac) {
- return MOD_CONT;
- }
-
if (!source) {
return MOD_CONT;
}
- m_away(source, av[0]);
- return MOD_CONT;
+ m_away(source, (ac ? av[0] : NULL));
+ return MOD_CONT;
}
int anope_event_ping(char *source, int ac, char **av)