Drop redundant chat(), sendmessage() parameter us
It can't be anything but the current player.
This commit is contained in:
parent
5eeac45b8d
commit
0d4566847f
1 changed files with 13 additions and 13 deletions
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
static int chat(struct natstr *, struct natstr *, char *);
|
static int chat(struct natstr *, char *);
|
||||||
static int sendmessage(struct natstr *, struct natstr *, char *, int);
|
static int sendmessage(struct natstr *, char *, int);
|
||||||
|
|
||||||
int
|
int
|
||||||
flash(void)
|
flash(void)
|
||||||
|
@ -69,13 +69,13 @@ flash(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return chat(us, to, player->comtail[2]);
|
return chat(to, player->comtail[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
wall(void)
|
wall(void)
|
||||||
{
|
{
|
||||||
return chat(getnatp(player->cnum), NULL, player->comtail[1]);
|
return chat(NULL, player->comtail[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,7 +85,7 @@ wall(void)
|
||||||
* Return RET_OK.
|
* Return RET_OK.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
chat(struct natstr *us, struct natstr *to, char *message)
|
chat(struct natstr *to, char *message)
|
||||||
{
|
{
|
||||||
char buf[1024]; /* UTF-8 */
|
char buf[1024]; /* UTF-8 */
|
||||||
|
|
||||||
|
@ -93,15 +93,15 @@ chat(struct natstr *us, struct natstr *to, char *message)
|
||||||
buf[0] = ':';
|
buf[0] = ':';
|
||||||
buf[1] = ' ';
|
buf[1] = ' ';
|
||||||
strcpy(buf+2, message);
|
strcpy(buf+2, message);
|
||||||
sendmessage(us, to, buf, 1);
|
sendmessage(to, buf, 1);
|
||||||
} else {
|
} else {
|
||||||
sendmessage(us, to, "...", 1);
|
sendmessage(to, "...", 1);
|
||||||
while (ugetstring("> ", buf)) {
|
while (ugetstring("> ", buf)) {
|
||||||
if (*buf == '.')
|
if (*buf == '.')
|
||||||
break;
|
break;
|
||||||
sendmessage(us, to, buf, 0);
|
sendmessage(to, buf, 0);
|
||||||
}
|
}
|
||||||
sendmessage(us, to, "<EOT>", 0);
|
sendmessage(to, "<EOT>", 0);
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ chat(struct natstr *us, struct natstr *to, char *message)
|
||||||
* verbose if VERBOSE.
|
* verbose if VERBOSE.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
sendmessage(struct natstr *us, struct natstr *to, char *message, int verbose)
|
sendmessage(struct natstr *to, char *message, int verbose)
|
||||||
{
|
{
|
||||||
struct player *other;
|
struct player *other;
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
|
@ -150,16 +150,16 @@ sendmessage(struct natstr *us, struct natstr *to, char *message, int verbose)
|
||||||
if (verbose)
|
if (verbose)
|
||||||
if (to)
|
if (to)
|
||||||
pr_flash(other, "FLASH from %s (#%d) @ %02d:%02d%s\n",
|
pr_flash(other, "FLASH from %s (#%d) @ %02d:%02d%s\n",
|
||||||
us->nat_cnam, us->nat_cnum, tm->tm_hour,
|
cname(player->cnum), player->cnum, tm->tm_hour,
|
||||||
tm->tm_min, message);
|
tm->tm_min, message);
|
||||||
else
|
else
|
||||||
pr_flash(other, "BROADCAST from %s (#%d) @ %02d:%02d%s\n",
|
pr_flash(other, "BROADCAST from %s (#%d) @ %02d:%02d%s\n",
|
||||||
us->nat_cnam, us->nat_cnum, tm->tm_hour,
|
cname(player->cnum), player->cnum, tm->tm_hour,
|
||||||
tm->tm_min, message);
|
tm->tm_min, message);
|
||||||
|
|
||||||
else
|
else
|
||||||
pr_flash(other, "%s (#%d): %s\n",
|
pr_flash(other, "%s (#%d): %s\n",
|
||||||
us->nat_cnam, us->nat_cnum, message);
|
cname(player->cnum), player->cnum, message);
|
||||||
sent++;
|
sent++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue