aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-04-14 14:07:22 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-04-14 14:07:22 +0200
commitb13fbf870d0e64b5fadf58eaff726dacd0f613dd (patch)
treeb4d253c98a2a6d27d707b17d2e571dcdc32224db
parentc84f13654fa766eca3b3c10a828e630dbc2813c3 (diff)
Reformatted com_it()
-rw-r--r--FICS/talkproc.c143
1 files changed, 79 insertions, 64 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c
index 8f3522b..97426cb 100644
--- a/FICS/talkproc.c
+++ b/FICS/talkproc.c
@@ -170,73 +170,88 @@ PUBLIC int com_cshout(int p, param_list param)
return COM_OK;
}
-PUBLIC int com_it(int p, param_list param)
+PUBLIC int
+com_it(int p, param_list param)
{
- int p1;
- int count = 0;
- int timeleft;
+ int count = 0;
+ int p1;
+ int timeleft;
- if (!parray[p].registered) {
- pprintf(p, "Only registered players can use the it command.\n");
- return COM_OK;
- }
- if (in_list(p, L_MUZZLE, parray[p].login)) {
- pprintf(p, "You are muzzled.\n");
- return COM_OK;
- }
- if (param[0].type == TYPE_NULL) {
- if ((timeleft = CheckShoutQuota(p))) {
- pprintf(p, "Next shout available in %d seconds.\n", timeleft);
- } else {
- pprintf(p, "Your next shout is ready for use.\n");
- }
- return COM_OK;
- }
- if ((timeleft = CheckShoutQuota(p))) {
- pprintf(p, "Shout not sent. Next shout in %d seconds.\n", timeleft);
- return COM_OK;
- }
- parray[p].lastshout_a = parray[p].lastshout_b;
- parray[p].lastshout_b = time(0);
+ if (!parray[p].registered) {
+ pprintf(p, "Only registered players can use the it command.\n");
+ return COM_OK;
+ }
- if (!printablestring(param[0].val.string)) {
- pprintf(p, "Your message contains some unprintable character(s).\n");
- return COM_OK;
- }
-/* in_push(IN_SHOUT); */
- for (p1 = 0; p1 < p_num; p1++) {
- if (p1 == p)
- continue;
- if (parray[p1].status != PLAYER_PROMPT)
- continue;
- if (!parray[p1].i_shout)
- continue;
- if (player_censored(p1, p))
- continue;
- count++;
- if ((!strncmp(param[0].val.string, "\'", 1)) ||
- (!strncmp(param[0].val.string, ",", 1)) ||
- (!strncmp(param[0].val.string, ".", 1))) {
- pprintf_prompt(p1, "\n--> %s%s\n", parray[p].name,
- param[0].val.string);
- } else {
- pprintf_prompt(p1, "\n--> %s %s\n", parray[p].name,
- param[0].val.string);
- }
- }
- if ((!strncmp(param[0].val.string, "\'", 1)) ||
- (!strncmp(param[0].val.string, ",", 1)) ||
- (!strncmp(param[0].val.string, ".", 1))) {
- pprintf(p, "(%d) --> %s%s\n", count, parray[p].name, param[0].val.string);
- } else {
- pprintf(p, "(%d) --> %s %s\n", count, parray[p].name, param[0].val.string);
- }
-/* in_pop(); */
- if ((timeleft = CheckShoutQuota(p))) {
- pprintf(p, "Next shout in %d seconds.\n", timeleft);
- return COM_OK;
- }
- return COM_OK;
+ if (in_list(p, L_MUZZLE, parray[p].login)) {
+ pprintf(p, "You are muzzled.\n");
+ return COM_OK;
+ }
+
+ if (param[0].type == TYPE_NULL) {
+ if ((timeleft = CheckShoutQuota(p))) {
+ pprintf(p, "Next shout available in %d seconds.\n",
+ timeleft);
+ } else {
+ pprintf(p, "Your next shout is ready for use.\n");
+ }
+
+ return COM_OK;
+ }
+
+ if ((timeleft = CheckShoutQuota(p))) {
+ pprintf(p, "Shout not sent. Next shout in %d seconds.\n",
+ timeleft);
+ return COM_OK;
+ }
+
+ parray[p].lastshout_a = parray[p].lastshout_b;
+ parray[p].lastshout_b = time(0);
+
+ if (!printablestring(param[0].val.string)) {
+ pprintf(p, "Your message contains some unprintable "
+ "character(s).\n");
+ return COM_OK;
+ }
+
+ for (p1 = 0; p1 < p_num; p1++) {
+ if (p1 == p)
+ continue;
+ if (parray[p1].status != PLAYER_PROMPT)
+ continue;
+ if (!parray[p1].i_shout)
+ continue;
+ if (player_censored(p1, p))
+ continue;
+
+ count++;
+
+ if (!strncmp(param[0].val.string, "\'", 1) ||
+ !strncmp(param[0].val.string, ",", 1) ||
+ !strncmp(param[0].val.string, ".", 1)) {
+ pprintf_prompt(p1, "\n--> %s%s\n", parray[p].name,
+ param[0].val.string);
+ } else {
+ pprintf_prompt(p1, "\n--> %s %s\n", parray[p].name,
+ param[0].val.string);
+ }
+ }
+
+ if (!strncmp(param[0].val.string, "\'", 1) ||
+ !strncmp(param[0].val.string, ",", 1) ||
+ !strncmp(param[0].val.string, ".", 1)) {
+ pprintf(p, "(%d) --> %s%s\n", count, parray[p].name,
+ param[0].val.string);
+ } else {
+ pprintf(p, "(%d) --> %s %s\n", count, parray[p].name,
+ param[0].val.string);
+ }
+
+ if ((timeleft = CheckShoutQuota(p))) {
+ pprintf(p, "Next shout in %d seconds.\n", timeleft);
+ return COM_OK;
+ }
+
+ return COM_OK;
}
PRIVATE int