+Thu Oct 8 15:34:45 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * room_ops.c: Added is_noneditable() function to replace all of the
+ duplicated code present in all functions which edit room parameters.
+
1998-10-08 Nathan Bryant <bryant@cs.usm.maine.edu>
* lots of warning fixes; builds with -std1 on dec unix
* aidepost.c, citadel.h, citmail.c, file_ops.c, msgbase.c, netmailer.c,
return(numitems);
}
-
+
+
+/*
+ * Determine whether a given room is one of the base non-editable rooms
+ */
+int is_noneditable(struct quickroom *qrbuf) {
+ if (!strcasecmp(qrbuf->QRname, BASEROOM)) return(0);
+ else if (!strcasecmp(qrbuf->QRname, AIDEROOM)) return(0);
+ elsereturn(1);
+ }
/*
* cmd_lrms() - List all accessible rooms, known or forgotten
return;
}
- if ( (!strcasecmp(CC->quickroom.QRname, BASEROOM))
- || (!strcasecmp(CC->quickroom.QRname, AIDEROOM)) ) {
+ if (is_noneditable(&CC->quickroom)) {
cprintf("%d Can't edit this room.\n",ERROR+NOT_HERE);
return;
}
return;
}
- if ( (!strcasecmp(CC->quickroom.QRname, BASEROOM))
- || (!strcasecmp(CC->quickroom.QRname, AIDEROOM)) ) {
+ if (is_noneditable(&CC->quickroom)) {
cprintf("%d Can't edit this room.\n",ERROR+NOT_HERE);
return;
}
return;
}
- if ( (!strcasecmp(CC->quickroom.QRname, BASEROOM))
- || (!strcasecmp(CC->quickroom.QRname, AIDEROOM)) ) {
+ if (is_noneditable(&CC->quickroom)) {
cprintf("%d Can't edit this room.\n",ERROR+NOT_HERE);
return;
}
return;
}
- if ( (!strcasecmp(CC->quickroom.QRname, BASEROOM))
- || (!strcasecmp(CC->quickroom.QRname, AIDEROOM)) ) {
+ if (is_noneditable(&CC->quickroom)) {
cprintf("%d Can't edit this room.\n",ERROR+NOT_HERE);
return;
}