Skip to content

Commit

Permalink
Merge pull request #70 from drskinner/COV-0107
Browse files Browse the repository at this point in the history
COV-0107: Restyle whisper command; enable for RS
  • Loading branch information
Myles Skinner committed Sep 12, 2018
2 parents b3efbfc + 5dc71fb commit 314ea13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions src/act_comm.c
Expand Up @@ -1069,10 +1069,11 @@ void do_whisper(CHAR_DATA* ch, const char* argument)
}
#endif

if (xIS_SET(ch->in_room->room_flags, ROOM_SILENCE) || IS_SET(ch->in_room->area->flags, AFLAG_SILENCE))
{
send_to_char("You can't do that here.\r\n", ch);
return;
if (ch->in_room) {
if (xIS_SET(ch->in_room->room_flags, ROOM_SILENCE) || IS_SET(ch->in_room->area->flags, AFLAG_SILENCE)) {
send_to_char("You can't do that here.\r\n", ch);
return;
}
}

REMOVE_BIT(ch->deaf, CHANNEL_WHISPER);
Expand Down Expand Up @@ -1177,27 +1178,27 @@ void do_whisper(CHAR_DATA* ch, const char* argument)
knows_language(ch, ch->speaking, victim));

if (speakswell < 85)
act(AT_WHISPER, "$n whispers to you '$t'", ch,
act(AT_WHISPER, "&m[&W$n&m] whispers to you '$t'&w", ch,
translate(speakswell, argument, lang_names[speaking]), victim, TO_VICT);
else
act(AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT);
act(AT_WHISPER, "&m[&W$n&m] whispers to you '$t'&w", ch, argument, victim, TO_VICT);
}
else
act(AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT);
act(AT_WHISPER, "&m[&W$n&m] whispers to you '$t'&w", ch, argument, victim, TO_VICT);
#else
if (!knows_language(vch, ch->speaking, ch) && (!IS_NPC(ch) || ch->speaking != 0))
act(AT_WHISPER, "$n whispers to you '$t'", ch,
act(AT_WHISPER, "&m[&W$n&m] whispers to you '$t'&w", ch,
translate(speakswell, argument, lang_names[speaking]), victim, TO_VICT);
else
act(AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT);
act(AT_WHISPER, "&m[&W$n&m] whispers to you '$t'&w", ch, argument, victim, TO_VICT);
#endif

MOBtrigger = TRUE;
if (!xIS_SET(ch->in_room->room_flags, ROOM_SILENCE) && !IS_SET(ch->in_room->area->flags, AFLAG_SILENCE))
if (ch->in_room && !xIS_SET(ch->in_room->room_flags, ROOM_SILENCE) && !IS_SET(ch->in_room->area->flags, AFLAG_SILENCE))
act(AT_WHISPER, "$n whispers something to $N.", ch, argument, victim, TO_NOTVICT);

victim->position = position;
if (xIS_SET(ch->in_room->room_flags, ROOM_LOGSPEECH))
if (ch->in_room && xIS_SET(ch->in_room->room_flags, ROOM_LOGSPEECH))
{
snprintf(buf, MAX_INPUT_LENGTH, "%s: %s (whisper to) %s.",
IS_NPC(ch) ? ch->short_descr : ch->name, argument, IS_NPC(victim) ? victim->short_descr : victim->name);
Expand Down
2 changes: 1 addition & 1 deletion src/color.h
Expand Up @@ -163,6 +163,7 @@ DECLARE_DO_FUN(do_color);
#define AT_SHOUT AT_LRED
#define AT_SOCIAL AT_PLAIN
#define AT_TELL AT_PINK
#define AT_WHISPER AT_PURPLE

#define AT_HIT 39
#define AT_HITME 40
Expand Down Expand Up @@ -201,7 +202,6 @@ DECLARE_DO_FUN(do_color);
#define AT_WHO 80 /* Added by Samson 9-29-98 for wholist */
#define AT_RACETALK 81 /* Added by Samson 9-29-98 for version 1.4 code */
#define AT_IGNORE 82 /* Added by Samson 9-29-98 for version 1.4 code */
#define AT_WHISPER 83 /* Added by Samson 9-29-98 for version 1.4 code */
#define AT_DIVIDER 84 /* Added by Samson 9-29-98 for version 1.4 code */
#define AT_MORPH 85 /* Added by Samson 9-29-98 for version 1.4 code */
#define AT_RFLAGS 87 /* Added by Samson 12-20-98 for room flag display line */
Expand Down

0 comments on commit 314ea13

Please sign in to comment.