Update of /cvsroot/havok/havokmud In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18894 Modified Files: Tag: rev_1_11 act.comm.c act.info.c act.off.c act.other.c act.wizard.c board.c comm.c create.help.c create.mob.c create.obj.c db.c dimd.c fight.c handler.c interpreter.c magic.c mind_use1.c modify.c protos.h reception.c skills.c spec_guildmaster.c spec_procs3.c spec_procs4.c spell_parser.c spells2.c utility.c Log Message: - changed all the "remove spaces" loops to use skip_spaces() - removed str_len() as it's useless and unused Index: create.obj.c =================================================================== RCS file: /cvsroot/havok/havokmud/create.obj.c,v retrieving revision 1.25.2.3 retrieving revision 1.25.2.4 diff -C2 -d -r1.25.2.3 -r1.25.2.4 *** create.obj.c 18 Mar 2004 03:43:33 -0000 1.25.2.3 --- create.obj.c 30 Apr 2004 05:40:32 -0000 1.25.2.4 *************** *** 208,212 **** char name[20]; struct obj_data *obj; - int i; if (IS_NPC(ch)) { --- 208,211 ---- *************** *** 233,242 **** */ #endif ! for (i = 0; *(argument + i) == ' '; i++) { ! /* ! * Empty loop ! */ ! } ! if (!*(argument + i)) { send_to_char("Oedit what?\n\r", ch); return; --- 232,238 ---- */ #endif ! ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Oedit what?\n\r", ch); return; Index: act.info.c =================================================================== RCS file: /cvsroot/havok/havokmud/act.info.c,v retrieving revision 1.150.2.18 retrieving revision 1.150.2.19 diff -C2 -d -r1.150.2.18 -r1.150.2.19 *** act.info.c 22 Apr 2004 16:49:47 -0000 1.150.2.18 --- act.info.c 30 Apr 2004 05:40:31 -0000 1.150.2.19 *************** *** 178,185 **** * Find first non blank */ ! for (; *(argument + begin) == ' '; begin++) { ! /* ! * Empty loop ! */ } --- 178,183 ---- * Find first non blank */ ! while (isspace(argument[begin])) { ! begin++; } *************** *** 187,197 **** * Find length of first word */ ! for (look_at = 0; *(argument + begin + look_at) > ' '; look_at++) { /* * Make all letters lower case, AND copy them to first_arg */ ! *(first_arg + look_at) = LOWER(*(argument + begin + look_at)); } ! *(first_arg + look_at) = '\0'; begin += look_at; --- 185,195 ---- * Find length of first word */ ! for (look_at = 0; argument[begin + look_at] > ' '; look_at++) { /* * Make all letters lower case, AND copy them to first_arg */ ! first_arg[look_at] = LOWER(argument[begin + look_at]); } ! first_arg[look_at] = '\0'; begin += look_at; *************** *** 199,206 **** * Find first non blank */ ! for (; *(argument + begin) == ' '; begin++) { ! /* ! * Empty loop ! */ } --- 197,202 ---- * Find first non blank */ ! while (isspace(argument[begin])) { ! begin++; } *************** *** 208,218 **** * Find length of second word */ ! for (look_at = 0; *(argument + begin + look_at) > ' '; look_at++) { /* * Make all letters lower case, AND copy them to second_arg */ ! *(second_arg + look_at) = LOWER(*(argument + begin + look_at)); } ! *(second_arg + look_at) = '\0'; begin += look_at; } --- 204,214 ---- * Find length of second word */ ! for (look_at = 0; argument[begin + look_at] > ' '; look_at++) { /* * Make all letters lower case, AND copy them to second_arg */ ! second_arg[look_at] = LOWER(argument[begin + look_at]); } ! second_arg[look_at] = '\0'; begin += look_at; } *************** *** 2849,2857 **** } ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (*argument) { --- 2845,2849 ---- } ! argument = skip_spaces(argument); if (*argument) { *************** *** 2964,2972 **** spellcheck = 0; ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (*argument) { --- 2956,2960 ---- spellcheck = 0; ! argument = skip_spaces(argument); if (*argument) { *************** *** 3185,3193 **** } ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (*argument) { --- 3173,3177 ---- } ! argument = skip_spaces(argument); if (*argument) { *************** *** 4131,4139 **** */ ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (!*argument) { --- 4115,4119 ---- */ ! argument = skip_spaces(argument); if (!*argument) { *************** *** 5270,5278 **** return; } - for (; isspace(*arg); arg++) { - /* - * Empty loop - */ - } if (!arg) { --- 5250,5253 ---- *************** *** 5281,5284 **** --- 5256,5261 ---- } + arg = skip_spaces(arg); + switch (*arg) { case 'w': Index: magic.c =================================================================== RCS file: /cvsroot/havok/havokmud/magic.c,v retrieving revision 1.52.2.7 retrieving revision 1.52.2.8 diff -C2 -d -r1.52.2.7 -r1.52.2.8 *** magic.c 28 Apr 2004 02:02:06 -0000 1.52.2.7 --- magic.c 30 Apr 2004 05:40:33 -0000 1.52.2.8 *************** *** 2886,2895 **** } if (obj->affected[i].location == APPLY_ARMOR || ! obj->affected[i].location == APPLY_SAVING_PARA || ! obj->affected[i].location == APPLY_SAVING_ROD || ! obj->affected[i].location == APPLY_SAVING_PETRI || ! obj->affected[i].location == APPLY_SAVING_BREATH || ! obj->affected[i].location == APPLY_SAVING_SPELL || ! obj->affected[i].location == APPLY_SAVE_ALL) { send_to_char("This item may not hold further enchantments.\n\r", ch); --- 2886,2896 ---- } if (obj->affected[i].location == APPLY_ARMOR || ! ((obj->affected[i].location == APPLY_SAVING_PARA || ! obj->affected[i].location == APPLY_SAVING_ROD || ! obj->affected[i].location == APPLY_SAVING_PETRI || ! obj->affected[i].location == APPLY_SAVING_BREATH || ! obj->affected[i].location == APPLY_SAVING_SPELL || ! obj->affected[i].location == APPLY_SAVE_ALL) && ! obj->affected[i].modifier != 0)) { send_to_char("This item may not hold further enchantments.\n\r", ch); Index: create.mob.c =================================================================== RCS file: /cvsroot/havok/havokmud/create.mob.c,v retrieving revision 1.14.2.3 retrieving revision 1.14.2.4 diff -C2 -d -r1.14.2.3 -r1.14.2.4 *** create.mob.c 17 Mar 2004 17:52:08 -0000 1.14.2.3 --- create.mob.c 30 Apr 2004 05:40:32 -0000 1.14.2.4 *************** *** 213,217 **** char name[20]; struct char_data *mob; - int i; if (IS_NPC(ch)) { --- 213,216 ---- *************** *** 228,238 **** return; } - for (i = 0; *(argument + i) == ' '; i++) { - /* - * Empty loop - */ - } ! if (!*(argument + i)) { send_to_char("Medit who?\n\r", ch); return; --- 227,233 ---- return; } ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Medit who?\n\r", ch); return; Index: act.other.c =================================================================== RCS file: /cvsroot/havok/havokmud/act.other.c,v retrieving revision 1.82.2.12 retrieving revision 1.82.2.13 diff -C2 -d -r1.82.2.12 -r1.82.2.13 *** act.other.c 22 Apr 2004 16:49:48 -0000 1.82.2.12 --- act.other.c 30 Apr 2004 05:40:32 -0000 1.82.2.13 *************** *** 86,94 **** return; } ! for (; isspace(*argument); argument++) { ! /* ! * Empty got loop ! */ ! } if (!*argument) { if (IS_SET(ch->specials.act, ACT_GUARDIAN)) { --- 86,91 ---- return; } ! ! argument = skip_spaces(argument); if (!*argument) { if (IS_SET(ch->specials.act, ACT_GUARDIAN)) { *************** *** 244,252 **** #endif ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (*argument) { if ((n = atoi(argument)) != 0) { --- 241,245 ---- #endif ! argument = skip_spaces(argument); if (*argument) { if ((n = atoi(argument)) != 0) { *************** *** 327,335 **** #endif ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } if (*argument) { if ((n = atoi(argument)) != 0) { --- 320,324 ---- #endif ! argument = skip_spaces(argument); if (*argument) { if ((n = atoi(argument)) != 0) { *************** *** 396,404 **** return; } ! for (; isspace(*argument); argument++) { ! /* ! * Empty for loop ! */ ! } if (*argument) { if (strlen(argument) > 150) { --- 385,390 ---- return; } ! ! argument = skip_spaces(argument); if (*argument) { if (strlen(argument) > 150) { *************** *** 980,989 **** } ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } ! if (!arg) { send_to_char("You need to supply a class for that.", ch); --- 966,970 ---- } ! arg = skip_spaces(arg); if (!arg) { send_to_char("You need to supply a class for that.", ch); *************** *** 1093,1102 **** * skip whites */ ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! if (!*argument) { send_to_char("That doesn't sound like a good idea to me.. Sorry.\n\r", --- 1074,1078 ---- * skip whites */ ! argument = skip_spaces(argument); if (!*argument) { send_to_char("That doesn't sound like a good idea to me.. Sorry.\n\r", *************** *** 1132,1141 **** * skip whites */ ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! if (!*argument) { send_to_char("I beg your pardon?\n\r", ch); --- 1108,1112 ---- * skip whites */ ! argument = skip_spaces(argument); if (!*argument) { send_to_char("I beg your pardon?\n\r", ch); *************** *** 1169,1178 **** * skip whites */ ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! if (!*argument) { send_to_char("Pardon?\n\r", ch); --- 1140,1144 ---- * skip whites */ ! argument = skip_spaces(argument); if (!*argument) { send_to_char("Pardon?\n\r", ch); *************** *** 1597,1605 **** * set ch->specials.group_name to the argument */ ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } send_to_char("Setting your group name to: ", ch); --- 1563,1567 ---- * set ch->specials.group_name to the argument */ ! arg = skip_spaces(arg); send_to_char("Setting your group name to: ", ch); *************** *** 2241,2249 **** if (cmd == 260) { ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } if (!*arg) { --- 2203,2207 ---- if (cmd == 260) { ! arg = skip_spaces(arg); if (!*arg) { Index: skills.c =================================================================== RCS file: /cvsroot/havok/havokmud/skills.c,v retrieving revision 1.55.2.6 retrieving revision 1.55.2.7 diff -C2 -d -r1.55.2.6 -r1.55.2.7 *** skills.c 20 Apr 2004 20:39:47 -0000 1.55.2.6 --- skills.c 30 Apr 2004 05:40:33 -0000 1.55.2.7 *************** *** 682,691 **** * make sure that the argument is a direction, or a keyword. */ ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } ! argument_interpreter(arg, type, direction); --- 682,686 ---- * make sure that the argument is a direction, or a keyword. */ ! arg = skip_spaces(arg); argument_interpreter(arg, type, direction); *************** *** 1179,1188 **** */ ! for (; isspace(*arg); arg++) { ! /* ! * Empty loops ! */ ! } ! only_argument(arg, direction); --- 1174,1178 ---- */ ! arg = skip_spaces(arg); only_argument(arg, direction); Index: act.comm.c =================================================================== RCS file: /cvsroot/havok/havokmud/act.comm.c,v retrieving revision 1.35.2.2 retrieving revision 1.35.2.3 diff -C2 -d -r1.35.2.2 -r1.35.2.3 *** act.comm.c 20 Apr 2004 20:35:49 -0000 1.35.2.2 --- act.comm.c 30 Apr 2004 05:40:31 -0000 1.35.2.3 *************** *** 23,27 **** void do_say(struct char_data *ch, char *argument, int cmd) { - int i; char buf[MAX_INPUT_LENGTH + 80]; --- 23,26 ---- *************** *** 31,47 **** return; ! for (i = 0; *(argument + i) == ' '; i++) { ! /* ! * Empty loop ! */ ! } ! ! if (!*(argument + i)) { send_to_char("Yes, but WHAT do you want to say?\n\r", ch); } else { ! sprintf(buf, "$c0015$n says '%s'", argument + i); act(buf, FALSE, ch, 0, 0, TO_ROOM); if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "$c0015You say '%s'\n\r", argument + i); send_to_char(buf, ch); } --- 30,41 ---- return; ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Yes, but WHAT do you want to say?\n\r", ch); } else { ! sprintf(buf, "$c0015$n says '%s'", argument); act(buf, FALSE, ch, 0, 0, TO_ROOM); if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "$c0015You say '%s'\n\r", argument); send_to_char(buf, ch); } *************** *** 112,121 **** } ! for (; *argument == ' '; argument++) { ! /* ! * Empty loop ! */ ! } ! if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { if (!IS_IMMORTAL(ch->master)) { --- 106,110 ---- } ! argument = skip_spaces(argument); if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { if (!IS_IMMORTAL(ch->master)) { *************** *** 197,206 **** } ! for (; *argument == ' '; argument++) { ! /* ! * Empty loop ! */ ! } ! if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { if (!IS_IMMORTAL(ch->master)) { --- 186,190 ---- } ! argument = skip_spaces(argument); if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { if (!IS_IMMORTAL(ch->master)) { *************** *** 278,290 **** dlog("in do_commune,think"); ! for (; *argument == ' '; argument++) { ! /* ! * Empty loop ! */ ! } ! if (!(*argument)) { ! send_to_char("Communing among the gods is fine, but WHAT?\n\r", ! ch); } else { if (argument[0] == '%') { --- 262,268 ---- dlog("in do_commune,think"); ! argument = skip_spaces(argument); if (!(*argument)) { ! send_to_char("Communing among the gods is fine, but WHAT?\n\r", ch); } else { if (argument[0] == '%') { *************** *** 626,648 **** "yaazr", "bipsnop", /* 50 */ - "\n" }; - int i; - for (i = 0; *rstring[i] != '\n'; i++) { - /* - * Empty loop - */ - } /* * count max number in * array */ ! return (rstring[number(0, i)]); } void do_sign(struct char_data *ch, char *argument, int cmd) { - int i; char buf[MAX_INPUT_LENGTH + 80]; char buf2[MAX_INPUT_LENGTH + 80]; --- 604,619 ---- "yaazr", "bipsnop", /* 50 */ }; + int rstringcount = NELEMS(rstring); /* * count max number in * array */ ! return (rstring[number(0, rstringcount-1)]); } void do_sign(struct char_data *ch, char *argument, int cmd) { char buf[MAX_INPUT_LENGTH + 80]; char buf2[MAX_INPUT_LENGTH + 80]; *************** *** 654,726 **** dlog("in do_sign"); ! for (i = 0; *(argument + i) == ' '; i++) { ! /* ! * Empty loop ! */ ! } ! ! if (!*(argument + i)) { send_to_char("Yes, but WHAT do you want to sign?\n\r", ch); ! } else { ! rp = real_roomp(ch->in_room); ! if (!rp) { ! return; ! } ! if (!HasHands(ch)) { ! send_to_char("Yeah right... WHAT HANDS!!!!!!!!\n\r", ch); ! return; ! } ! strcpy(buf, argument + i); ! buf2[0] = '\0'; /* ! * work through the argument, word by ! * word. if you fail your skill roll, the ! * word comes out garbled. */ ! p = strtok(buf, " "); /* first word */ ! diff = strlen(buf); ! while (p) { ! if (ch->skills ! && number(1, ! 75 + strlen(p)) < ! ch->skills[SKILL_SIGN].learned) { ! strcat(buf2, p); ! } else { ! strcat(buf2, RandomWord()); ! } ! strcat(buf2, " "); ! diff -= 1; ! p = strtok(0, " "); ! /* ! * next word ! */ } /* ! * if a recipient fails a roll, a word comes out garbled. */ ! /* ! * buf2 is now the "corrected" string. ! */ ! sprintf(buf, "$n signs '%s'", buf2); ! for (t = rp->people; t; t = t->next_in_room) { ! if (t != ch) { ! if (t->skills ! && number(1, diff) < t->skills[SKILL_SIGN].learned) { ! act(buf, FALSE, ch, 0, t, TO_VICT); ! } else { ! act("$n makes funny motions with $s hands", ! FALSE, ch, 0, t, TO_VICT); ! } } } ! if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "You sign '%s'\n\r", argument + i); ! send_to_char(buf, ch); ! } } } --- 625,691 ---- dlog("in do_sign"); ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Yes, but WHAT do you want to sign?\n\r", ch); ! return; ! } ! rp = real_roomp(ch->in_room); ! if (!rp) { ! return; ! } ! if (!HasHands(ch)) { ! send_to_char("Yeah right... WHAT HANDS!!!!!!!!\n\r", ch); ! return; ! } ! strcpy(buf, argument); ! buf2[0] = '\0'; /* ! * work through the argument, word by ! * word. if you fail your skill roll, the ! * word comes out garbled. */ ! p = strtok(buf, " "); /* first word */ ! ! diff = strlen(buf); ! ! while (p) { ! if (ch->skills && ! number(1, 75 + strlen(p)) < ch->skills[SKILL_SIGN].learned) { ! strcat(buf2, p); ! } else { ! strcat(buf2, RandomWord()); } + strcat(buf2, " "); + diff -= 1; + p = strtok(0, " "); /* ! * next word */ + } + /* + * if a recipient fails a roll, a word comes out garbled. + */ ! /* ! * buf2 is now the "corrected" string. ! */ ! sprintf(buf, "$n signs '%s'", buf2); ! for (t = rp->people; t; t = t->next_in_room) { ! if (t != ch) { ! if (t->skills && number(1, diff) < t->skills[SKILL_SIGN].learned) { ! act(buf, FALSE, ch, 0, t, TO_VICT); ! } else { ! act("$n makes funny motions with $s hands", ! FALSE, ch, 0, t, TO_VICT); } } + } ! if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "You sign '%s'\n\r", argument); ! send_to_char(buf, ch); } } *************** *** 800,805 **** void do_new_say(struct char_data *ch, char *argument, int cmd) { ! int ii, ! learned, skill_num; char buf[MAX_INPUT_LENGTH + 80]; --- 765,769 ---- void do_new_say(struct char_data *ch, char *argument, int cmd) { ! int learned, skill_num; char buf[MAX_INPUT_LENGTH + 80]; *************** *** 816,970 **** return; ! for (ii = 0; *(argument + ii) == ' '; ii++) { ! /* ! * Empty loop ! */ ! } ! ! if (!argument[ii]) { send_to_char("Yes, but WHAT do you want to say?\n\r", ch); } else { ! if (apply_soundproof(ch)) { ! return; ! } ! rp = real_roomp(ch->in_room); ! if (!rp) { ! return; ! } ! if (!ch->skills) { ! learned = 0; skill_num = LANG_COMMON; ! } else { ! /* ! * find the language we are speaking ! */ ! ! switch (ch->player.speaks) { ! case SPEAK_COMMON: ! learned = ch->skills[LANG_COMMON].learned; ! skill_num = LANG_COMMON; ! break; ! case SPEAK_ELVISH: ! learned = ch->skills[LANG_ELVISH].learned; ! skill_num = LANG_ELVISH; ! break; ! case SPEAK_HALFLING: ! learned = ch->skills[LANG_HALFLING].learned; ! skill_num = LANG_HALFLING; ! break; ! case SPEAK_DWARVISH: ! learned = ch->skills[LANG_DWARVISH].learned; ! skill_num = LANG_DWARVISH; ! break; ! case SPEAK_ORCISH: ! learned = ch->skills[LANG_ORCISH].learned; ! skill_num = LANG_ORCISH; ! break; ! case SPEAK_GIANTISH: ! learned = ch->skills[LANG_GIANTISH].learned; ! skill_num = LANG_GIANTISH; ! break; ! case SPEAK_OGRE: ! learned = ch->skills[LANG_OGRE].learned; ! skill_num = LANG_OGRE; ! break; ! case SPEAK_GNOMISH: ! learned = ch->skills[LANG_GNOMISH].learned; ! skill_num = LANG_GNOMISH; ! break; ! case SPEAK_ALL: ! learned = 100; ! skill_num = LANG_COMMON; ! break; ! default: ! learned = ch->skills[LANG_COMMON].learned; ! skill_num = LANG_COMMON; ! break; ! } } ! strcpy(buf, argument + ii); ! buf2[0] = '\0'; ! /* ! * we use this for ESP and immortals and comprehend lang ! */ ! sprintf(buf3, "$c0015[$c0005$n$c0015] says '%s'", buf); ! /* ! * work through the argument, word by word. if you fail your ! * skill roll, the word comes out garbled. ! */ ! p = strtok(buf, " "); ! /* ! * first word ! */ ! diff = strlen(buf); ! while (p) { ! if (number(1, 75 + strlen(p)) < learned ! || IS_IMMORTAL(ch)) { ! strcat(buf2, p); ! } else { ! /* ! * add case statement here to use random words from clips ! * of elvish, dwarvish etc so the words look like they came ! * from that language ! */ ! strcat(buf2, RandomWord()); ! } ! strcat(buf2, " "); ! diff -= 1; ! p = strtok(0, " "); /* ! * next word */ } /* ! * if a recipient fails a roll, a word comes out garbled. */ ! /* ! * buf2 is now the "corrected" string. ! */ ! if (!*buf2 || !buf2) { ! send_to_char("Yes, but WHAT do you want to say?\n\r", ch); ! return; ! } ! sprintf(buf, "$c0015[$c0005$n$c0015] says '%s'", buf2); ! for (t = rp->people; t; t = t->next_in_room) { ! if (t != ch) { ! if ((t->skills) && ! (number(1, diff) < t->skills[skill_num].learned || ! IS_IMMORTAL(t) || IS_NPC(t) || ! affected_by_spell(t, SKILL_ESP) || ! affected_by_spell(t, SPELL_COMP_LANGUAGES) || ! ch->player.speaks == 9)) { ! /* ! * these guys always understand ! */ ! if (IS_IMMORTAL(t) || IS_NPC(t) || ! affected_by_spell(t, SKILL_ESP) || ! affected_by_spell(t, SPELL_COMP_LANGUAGES) || ! IS_NPC(t) || ch->player.speaks == SPEAK_ALL) { ! act(buf3, FALSE, ch, 0, t, TO_VICT); ! } else { ! act(buf, FALSE, ch, 0, t, TO_VICT); ! } } else { ! act("$c0010$n speaks in a language you can't quite " ! "understand.", FALSE, ch, 0, t, TO_VICT); } } } ! if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "$c0015You say '%s'", argument + ii); ! act(buf, FALSE, ch, 0, 0, TO_CHAR); ! } } } --- 780,930 ---- return; ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Yes, but WHAT do you want to say?\n\r", ch); + return; + } + + if (apply_soundproof(ch)) { + return; + } + + rp = real_roomp(ch->in_room); + if (!rp) { + return; + } + + if (!ch->skills) { + learned = 0; + skill_num = LANG_COMMON; } else { + /* + * find the language we are speaking + */ ! switch (ch->player.speaks) { ! case SPEAK_COMMON: ! learned = ch->skills[LANG_COMMON].learned; skill_num = LANG_COMMON; ! break; ! case SPEAK_ELVISH: ! learned = ch->skills[LANG_ELVISH].learned; ! skill_num = LANG_ELVISH; ! break; ! case SPEAK_HALFLING: ! learned = ch->skills[LANG_HALFLING].learned; ! skill_num = LANG_HALFLING; ! break; ! case SPEAK_DWARVISH: ! learned = ch->skills[LANG_DWARVISH].learned; ! skill_num = LANG_DWARVISH; ! break; ! case SPEAK_ORCISH: ! learned = ch->skills[LANG_ORCISH].learned; ! skill_num = LANG_ORCISH; ! break; ! case SPEAK_GIANTISH: ! learned = ch->skills[LANG_GIANTISH].learned; ! skill_num = LANG_GIANTISH; ! break; ! case SPEAK_OGRE: ! learned = ch->skills[LANG_OGRE].learned; ! skill_num = LANG_OGRE; ! break; ! case SPEAK_GNOMISH: ! learned = ch->skills[LANG_GNOMISH].learned; ! skill_num = LANG_GNOMISH; ! break; ! case SPEAK_ALL: ! learned = 100; ! skill_num = LANG_COMMON; ! break; ! default: ! learned = ch->skills[LANG_COMMON].learned; ! skill_num = LANG_COMMON; ! break; } + } ! strcpy(buf, argument); ! buf2[0] = '\0'; ! /* ! * we use this for ESP and immortals and comprehend lang ! */ ! sprintf(buf3, "$c0015[$c0005$n$c0015] says '%s'", buf); ! /* ! * work through the argument, word by word. if you fail your ! * skill roll, the word comes out garbled. ! */ ! p = strtok(buf, " "); ! /* ! * first word ! */ ! diff = strlen(buf); ! while (p) { ! if (number(1, 75 + strlen(p)) < learned || IS_IMMORTAL(ch)) { ! strcat(buf2, p); ! } else { /* ! * add case statement here to use random words from clips ! * of elvish, dwarvish etc so the words look like they came ! * from that language */ + strcat(buf2, RandomWord()); } + strcat(buf2, " "); + diff -= 1; + p = strtok(0, " "); /* ! * next word */ + } + /* + * if a recipient fails a roll, a word comes out garbled. + */ ! /* ! * buf2 is now the "corrected" string. ! */ ! if (!buf2 || !*buf2) { ! send_to_char("Yes, but WHAT do you want to say?\n\r", ch); ! return; ! } ! sprintf(buf, "$c0015[$c0005$n$c0015] says '%s'", buf2); ! for (t = rp->people; t; t = t->next_in_room) { ! if (t != ch) { ! if ((t->skills) && ! (number(1, diff) < t->skills[skill_num].learned || ! IS_IMMORTAL(t) || IS_NPC(t) || ! affected_by_spell(t, SKILL_ESP) || ! affected_by_spell(t, SPELL_COMP_LANGUAGES) || ! ch->player.speaks == 9)) { ! /* ! * these guys always understand ! */ ! if (IS_IMMORTAL(t) || IS_NPC(t) || ! affected_by_spell(t, SKILL_ESP) || ! affected_by_spell(t, SPELL_COMP_LANGUAGES) || ! IS_NPC(t) || ch->player.speaks == SPEAK_ALL) { ! act(buf3, FALSE, ch, 0, t, TO_VICT); } else { ! act(buf, FALSE, ch, 0, t, TO_VICT); } + } else { + act("$c0010$n speaks in a language you can't quite " + "understand.", FALSE, ch, 0, t, TO_VICT); } } + } ! if (IS_NPC(ch) || (IS_SET(ch->specials.act, PLR_ECHO))) { ! sprintf(buf, "$c0015You say '%s'", argument); ! act(buf, FALSE, ch, 0, 0, TO_CHAR); } } *************** *** 972,976 **** void do_gtell(struct char_data *ch, char *argument, int cmd) { - int i; struct char_data *k; struct follow_type *f; --- 932,935 ---- *************** *** 982,992 **** return; } - for (i = 0; *(argument + i) == ' '; i++) { - /* - * Empty loop - */ - } ! if (!*(argument + i)) { send_to_char("What do you want to group tell!??\n\r", ch); return; --- 941,948 ---- return; } ! argument = skip_spaces(argument); ! ! if (!*argument) { send_to_char("What do you want to group tell!??\n\r", ch); return; *************** *** 996,1059 **** send_to_char("But you are a member of no group?!\n\r", ch); return; } else { ! if (ch->master) { ! k = ch->master; ! } else { ! k = ch; ! } ! for (f = k->followers; f; f = f->next) { ! if (IS_AFFECTED(f->follower, AFF_GROUP)) { ! if (!f->follower->desc) { ! /* ! * link dead ! */ ! } else if (ch == f->follower) { ! /* ! * can't tell yourself! ! */ ! } else if (!check_soundproof(f->follower)) { ! sprintf(buf, ! "$c0012[$c0015%s$c0012] group tells you '%s'", ! (IS_NPC(ch) ? ch->player. ! short_descr : GET_NAME(ch)), argument + i); ! act(buf, FALSE, f->follower, 0, 0, TO_CHAR); ! } } } ! /* ! * send to master now ! */ ! if (ch->master) { ! if (IS_AFFECTED(ch->master, AFF_GROUP)) { ! if (!ch->master->desc) { ! /* ! * link dead ! */ ! } else if (ch == ch->master) { ! /* ! * can't tell yourself! ! */ ! } else if (!check_soundproof(ch->master)) { ! sprintf(buf, ! "$c0012[$c0015%s$c0012] group tells you '%s'", ! (IS_NPC(ch) ? ch->player. ! short_descr : GET_NAME(ch)), argument + i); ! act(buf, FALSE, ch->master, 0, 0, TO_CHAR); ! } ! } } ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf, "$c0012You group tell '%s'", argument + i); ! act(buf, FALSE, ch, 0, 0, TO_CHAR); ! } } } - /* - * 'Split' originally by Gnort, God of Chaos. I stole it from Merc - * and changed it to work with mine :) Heh msw - */ void do_split(struct char_data *ch, char *argument, int cmd) --- 952,1011 ---- send_to_char("But you are a member of no group?!\n\r", ch); return; + } + + if (ch->master) { + k = ch->master; } else { ! k = ch; ! } ! for (f = k->followers; f; f = f->next) { ! if (IS_AFFECTED(f->follower, AFF_GROUP)) { ! if (!f->follower->desc) { ! /* ! * link dead ! */ ! } else if (ch == f->follower) { ! /* ! * can't tell yourself! ! */ ! } else if (!check_soundproof(f->follower)) { ! sprintf(buf, ! "$c0012[$c0015%s$c0012] group tells you '%s'", ! (IS_NPC(ch) ? ch->player. ! short_descr : GET_NAME(ch)), argument); ! act(buf, FALSE, f->follower, 0, 0, TO_CHAR); } } + } ! /* ! * send to master now ! */ ! if (ch->master) { ! if (IS_AFFECTED(ch->master, AFF_GROUP)) { ! if (!ch->master->desc) { ! /* ! * link dead ! */ ! } else if (ch == ch->master) { ! /* ! * can't tell yourself! ! */ ! } else if (!check_soundproof(ch->master)) { ! sprintf(buf, ! "$c0012[$c0015%s$c0012] group tells you '%s'", ! (IS_NPC(ch) ? ch->player. ! short_descr : GET_NAME(ch)), argument); ! act(buf, FALSE, ch->master, 0, 0, TO_CHAR); ! } } + } ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf, "$c0012You group tell '%s'", argument); ! act(buf, FALSE, ch, 0, 0, TO_CHAR); } } void do_split(struct char_data *ch, char *argument, int cmd) *************** *** 1156,1201 **** } ! for (; *argument == ' '; argument++) { ! /* ! * Empty loop ! */ ! } ! ! if (!(*argument)) { send_to_char("Pray to a deity, but what?!?! (pray <DeityName> " "<prayer>)\n\r", ch); ! } else { ! ii = ((int) GetMaxLevel(ch) * 3.5); ! if (HasClass(ch, CLASS_CLERIC | CLASS_DRUID)) { ! ii += 10; ! /* ! * clerics get a 10% bonus :) ! */ ! } ! if (ii > number(1, 101)) { ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf1, "You pray '%s'\n\r", argument); ! send_to_char(buf1, ch); ! } ! sprintf(buf1, "$c0014:*:$c0012$n$c0014:*: prays '$c0012%s$c0014'", ! argument); ! for (i = descriptor_list; i; i = i->next) { ! if (i->character != ch && !i->connected && ! !IS_SET(i->character->specials.act, PLR_NOSHOUT) && ! IS_IMMORTAL(i->character)) { ! act(buf1, 0, ch, 0, i->character, TO_VICT); ! } } ! } else { ! send_to_char("Your prayer is ignored at this time.\n\r", ch); ! } ! af.type = SPELL_PRAYER; ! af.duration = 24; ! af.modifier = 0; ! af.location = APPLY_NONE; ! af.bitvector = 0; ! affect_to_char(ch, &af); } } --- 1108,1150 ---- } ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Pray to a deity, but what?!?! (pray <DeityName> " "<prayer>)\n\r", ch); ! return; ! } ! ii = ((int) GetMaxLevel(ch) * 3.5); ! if (HasClass(ch, CLASS_CLERIC | CLASS_DRUID)) { ! ii += 10; ! /* ! * clerics get a 10% bonus :) ! */ ! } ! ! if (ii > number(1, 101)) { ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf1, "You pray '%s'\n\r", argument); ! send_to_char(buf1, ch); ! } ! sprintf(buf1, "$c0014:*:$c0012$n$c0014:*: prays '$c0012%s$c0014'", ! argument); ! ! for (i = descriptor_list; i; i = i->next) { ! if (i->character != ch && !i->connected && ! !IS_SET(i->character->specials.act, PLR_NOSHOUT) && ! IS_IMMORTAL(i->character)) { ! act(buf1, 0, ch, 0, i->character, TO_VICT); } ! } ! } else { ! send_to_char("Your prayer is ignored at this time.\n\r", ch); } + af.type = SPELL_PRAYER; + af.duration = 24; + af.modifier = 0; + af.location = APPLY_NONE; + af.bitvector = 0; + affect_to_char(ch, &af); } *************** *** 1322,1330 **** return; } ! for (; *argument == ' '; argument++) { ! /* ! * Empty loop ! */ ! } if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { --- 1271,1276 ---- return; } ! ! argument = skip_spaces(argument); if (ch->master && IS_AFFECTED(ch, AFF_CHARM)) { *************** *** 1335,1371 **** } ! if (!(*argument)) { ! send_to_char("Hrm... normally, you should OOC something...\n\r", ! ch); ! } else { ! if (argument[0] == '%') { ! do_OOCaction(ch, argument, cmd); ! return; ! } else if (argument[0] == '#') { ! do_OOCemote(ch, argument, cmd); ! return; ! } ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf1, "$c0012You $c0015OOC$c0012 '$c0015%s$c0012'", ! argument); ! act(buf1, FALSE, ch, 0, 0, TO_CHAR); ! } ! sprintf(buf1, "$c0012-=$c0015$n$c0012=- OOCs '$c0015%s$c0012'", ! argument); ! if (!IS_IMMORTAL(ch)) { ! GET_MOVE(ch) -= 5; ! GET_MANA(ch) -= 5; } - for (i = descriptor_list; i; i = i->next) { - if (i->character != ch && !i->connected - && (IS_NPC(i->character) - || (!IS_SET(i->character->specials.act, PLR_NOSHOUT) - && !IS_SET(i->character->specials.act, PLR_NOOOC) - && !IS_SET(i->character->specials.act, - PLR_WIZNOOOC))) - && !check_soundproof(i->character)) { - act(buf1, 0, ch, 0, i->character, TO_VICT); - } - } } } --- 1281,1318 ---- } ! if (!*argument) { ! send_to_char("Hrm... normally, you should OOC something...\n\r", ch); ! return; ! } ! ! if (*argument == '%') { ! do_OOCaction(ch, argument, cmd); ! return; ! } ! ! if (*argument == '#') { ! do_OOCemote(ch, argument, cmd); ! return; ! } ! ! if (IS_NPC(ch) || IS_SET(ch->specials.act, PLR_ECHO)) { ! sprintf(buf1, "$c0012You $c0015OOC$c0012 '$c0015%s$c0012'", argument); ! act(buf1, FALSE, ch, 0, 0, TO_CHAR); ! } ! sprintf(buf1, "$c0012-=$c0015$n$c0012=- OOCs '$c0015%s$c0012'", argument); ! if (!IS_IMMORTAL(ch)) { ! GET_MOVE(ch) -= 5; ! GET_MANA(ch) -= 5; ! } ! ! for (i = descriptor_list; i; i = i->next) { ! if (i->character != ch && !i->connected && ! (IS_NPC(i->character) || ! (!IS_SET(i->character->specials.act, PLR_NOSHOUT) && ! !IS_SET(i->character->specials.act, PLR_NOOOC) && ! !IS_SET(i->character->specials.act, PLR_WIZNOOOC))) && ! !check_soundproof(i->character)) { ! act(buf1, 0, ch, 0, i->character, TO_VICT); } } } Index: reception.c =================================================================== RCS file: /cvsroot/havok/havokmud/reception.c,v retrieving revision 1.43.2.7 retrieving revision 1.43.2.8 diff -C2 -d -r1.43.2.7 -r1.43.2.8 *** reception.c 22 Apr 2004 16:49:48 -0000 1.43.2.7 --- reception.c 30 Apr 2004 05:40:33 -0000 1.43.2.8 *************** *** 1519,1527 **** if( s ) { /* eat leading spaces and trailing carriage return/linefeed */ ! for (; isspace(*s); s++) { ! /* ! * Empty loop ! */ ! } while(strchr(s, '\n')) { --- 1519,1523 ---- if( s ) { /* eat leading spaces and trailing carriage return/linefeed */ ! s = skip_spaces(s); while(strchr(s, '\n')) { Index: act.wizard.c =================================================================== RCS file: /cvsroot/havok/havokmud/act.wizard.c,v retrieving revision 1.121.2.15 retrieving revision 1.121.2.16 diff -C2 -d -r1.121.2.15 -r1.121.2.16 *** act.wizard.c 20 Apr 2004 20:36:35 -0000 1.121.2.15 --- act.wizard.c 30 Apr 2004 05:40:32 -0000 1.121.2.16 *************** *** 382,391 **** * pass all those spaces */ ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } ! if (!*arg) { send_to_char("Your current bamfin is:\n\r", ch); --- 382,386 ---- * pass all those spaces */ ! arg = skip_spaces(arg); if (!*arg) { send_to_char("Your current bamfin is:\n\r", ch); *************** *** 437,445 **** * pass all those spaces */ ! for (; isspace(*arg); arg++) { ! /* ! * Empty loop ! */ ! } if (!*arg) { send_to_char("Your current bamfout is:\n\r", ch); --- 432,436 ---- * pass all those spaces */ ! arg = skip_spaces(arg); if (!*arg) { send_to_char("Your current bamfout is:\n\r", ch); *************** *** 686,690 **** { #if SITELOCK - char *test; int a, length, --- 677,680 ---- *************** *** 709,721 **** */ ! for (test = argument; *test && isspace(*test); test++) { ! /* ! * Empty loop ! */ ! } ! if (!*test) { return; } - argument = test; /* * get first piece.. --- 699,706 ---- */ ! argument = skip_spaces(argument); ! if (!*argument) { return; } /* * get first piece.. *************** *** 754,767 **** return; } ! for (test = argument; *test && isspace(*test); test++) { ! /* ! * Empty loop ! */ ! } ! if (!*test) { send_to_char("Siteban rem <host_name>\n\r", ch); return; } - argument = test; argument = one_argument(argument, buf); if (!*buf) { --- 739,747 ---- return; } ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("Siteban rem <host_name>\n\r", ch); return; } argument = one_argument(argument, buf); if (!*buf) { *************** *** 817,826 **** return; } ! for (i = 0; isspace(argument[i]); i++) { ! /* ! * Empty loop ! */ ! } ! if (!argument[i]) { send_to_char("rload <start> [<end>]\n\r", ch); return; --- 797,803 ---- return; } ! ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("rload <start> [<end>]\n\r", ch); return; *************** *** 873,882 **** return; } ! for (i = 0; isspace(argument[i]); i++) { ! /* ! * Empty loop ! */ ! } ! if (!argument[i]) { start = ch->in_room; if (!(start > 0 && start < WORLD_SIZE)) { --- 850,856 ---- return; } ! ! argument = skip_spaces(argument); ! if (!*argument) { start = ch->in_room; if (!(start > 0 && start < WORLD_SIZE)) { *************** *** 920,931 **** void do_emote(struct char_data *ch, char *arg, int cmd) { - int i; char buf[MAX_INPUT_LENGTH + 40]; - #if 0 - char name[255], oriarg[MAX_STRING_LENGTH], *copy; - int j, k, found, extra; - char part1[MAX_STRING_LENGTH],part2[MAX_STRING_LENGTH], sign[10]; - struct char_data *vict; - #endif dlog("in do_emote"); --- 894,898 ---- *************** *** 933,1135 **** return; } - for (i = 0; *(arg + i) == ' '; i++) { - /* - * Empty loop - */ - } - if (!*(arg + i)) { - send_to_char("Yes.. But what?\n\r", ch); - } else { - sprintf(buf, "$n %s", arg + i); - act(buf, FALSE, ch, 0, 0, TO_ROOM); - if (IS_SET(ch->specials.act, PLR_ECHO)) { - act(buf, FALSE, ch, 0, 0, TO_CHAR); - } else { - send_to_char("Ok.\n\r", ch); - } - } - #if 0 - #if 1 - i = 0; - j = 0; - k = 0; - found = 0; - sprintf(name, ""); - sprintf(part1, ""); - sprintf(oriarg, "%s",arg); if (!*arg) { ! send_to_char("Yes, but what?\n\r",ch); return; } - while (*arg && arg[0] != '*') { - half_chop(arg, buf, arg); sprintf(part1, "%s %s",part1, buf); - } - if (*arg && arg[0] == '*' && arg[1] == ' ') { - half_chop(arg, sign, arg); - half_chop(arg, name, part2); - found = 1; - } - if(found) { - if (!(vict = get_char_room_vis(ch, name))) { - sprintf(buf, "Noone here by the name of %s.\n\r",name); - send_to_char(buf, ch); - return; - } else { - sprintf(buf, "$n%s $N %s", part1, part2); - act(buf, FALSE, ch, 0, vict, TO_NOTVICT); - act(buf, FALSE, ch, 0, vict, TO_CHAR); - sprintf(buf, "$n%s you %s", part1, part2); - act(buf, FALSE, ch, 0, vict, TO_VICT); - } - } else { - for (i = 0; *(oriarg + i) == ' '; i++) { - /* - * Empty loop - */ - } - if (!*(oriarg + i)) { - send_to_char("Yes.. But what?\n\r", ch); - } else { - sprintf(buf,"$n %s", oriarg + i); - act(buf,FALSE,ch,0,0,TO_ROOM); - if (IS_SET(ch->specials.act,PLR_ECHO)) { - act(buf,FALSE,ch,0,0,TO_CHAR); - } else { - send_to_char("Ok.\n\r",ch); - } - } - } - #else - Log("enter"); - i = 0; - j = 0; - k = 0; - found = 0; - extra = 0; - /* - * sprintf(name, ""); - */ - /* - * (remember to make a *name) - */ - sprintf(part1, ""); - sprintf(oriarg, "%s",arg); ! if(!*arg) { ! Log("no arg"); ! send_to_char("Yes, but what?\n\r",ch); ! return; ! } ! while(*arg && arg[0] != '*'&& arg[1] != ' ') { ! Log("processing words before asterisk"); ! half_chop(arg, buf, arg); ! sprintf(part1, "%s %s",part1, buf); ! } ! if(*arg && arg[0] == '*' && arg[1] != ' ') { ! sprintf(copy, "%s",arg); ! if (GetMaxLevel(ch) < IMMORTAL) { ! for (; *copy == '*'; copy++) { ! /* ! * Empty loop ! */ ! } ! } ! for (; *copy; copy++, name++) { ! if (*copy == ' ') { ! break; ! } ! if(*copy == '*') { ! extra = 1; ! break; ! } ! *name = *copy; ! } ! *name = '\0'; ! if (extra) { ! for (; !isspace(*copy); copy++) { ! /* ! * Empty loop ! */ ! } ! } ! /* ! * get rid of any junk til we meet a space ! */ ! for (; isspace(*copy); copy++){ ! /* ! * Empty loop ! */ ! } ! /* ! * get rid of space ! */ ! for (; *arg = *copy; arg++, copy++) { ! /* ! * Empty loop ! */ ! } ! /* ! * stick remainder into arg ! */ ! found = 1; ! Log("found legal asterisk"); ! } ! if(found) { ! Log("entered the complicated emote"); ! /* ! * see if there's a dude in the room with this name ! */ ! if (!(vict = get_char_room_vis(ch, name))) { ! Log("no target found"); ! sprintf(buf, "Noone here by the name of %s.\n\r",name); ! send_to_char(buf, ch); ! return; ! } else { ! Log("target found"); ! /* ! * now fix up buffers, do the acts ! */ ! if (extra) { ! sprintf(buf, "$n%s $N's %s", part1, part2); ! } else { ! sprintf(buf, "$n%s $N %s", part1, part2); ! } ! act(buf, FALSE, ch, 0, vict, TO_NOTVICT); ! act(buf, FALSE, ch, 0, vict, TO_CHAR); ! if (extra) { ! sprintf(buf, "$n%s your %s", part1, part2); ! } else { ! sprintf(buf, "$n%s you %s", part1, part2); ! } ! act(buf, FALSE, ch, 0, vict, TO_VICT); ! } } else { ! Log("entered the simple emote"); ! for (i = 0; *(oriarg + i) == ' '; i++) { ! /* ! * Empty loop ! */ ! } ! if (!*(oriarg + i)) { ! send_to_char("Yes.. But what?\n\r", ch); ! } else { ! sprintf(buf,"$n %s", oriarg + i); ! act(buf,FALSE,ch,0,0,TO_ROOM); ! if (IS_SET(ch->specials.act,PLR_ECHO)) { ! act(buf,FALSE,ch,0,0,TO_CHAR); ! } else { ! send_to_char("Ok.\n\r",ch); ! } ! } } - #endif - #endif - } void do_echo(struct char_data *ch, char *argument, int cmd) { - int i; char buf[MAX_INPUT_LENGTH + 80]; --- 900,922 ---- return; } + arg = skip_spaces(arg); if (!*arg) { ! send_to_char("Yes.. But what?\n\r", ch); return; } ! sprintf(buf, "$n %s", arg); ! act(buf, FALSE, ch, 0, 0, TO_ROOM); ! if (IS_SET(ch->specials.act, PLR_ECHO)) { ! act(buf, FALSE, ch, 0, 0, TO_CHAR); } else { ! send_to_char("Ok.\n\r", ch); } } + void do_echo(struct char_data *ch, char *argument, int cmd) { char buf[MAX_INPUT_LENGTH + 80]; *************** *** 1139,1148 **** return; } ! for (i = 0; *(argument + i) == ' '; i++) { ! /* ! * Empty loop ! */ ! } ! if (!*(argument + i)) { if (IS_SET(ch->specials.act, PLR_ECHO)) { send_to_char("echo off\n\r", ch); --- 926,932 ---- return; } ! ! argument = skip_spaces(argument); ! if (!*argument) { if (IS_SET(ch->specials.act, PLR_ECHO)) { send_to_char("echo off\n\r", ch); *************** *** 1154,1158 **** } else { if (IS_IMMORTAL(ch)) { ! sprintf(buf, "%s\n\r", argument + i); send_to_room_except(buf, ch->in_room, ch); send_to_char("Ok.\n\r", ch); --- 938,942 ---- } else { if (IS_IMMORTAL(ch)) { ! sprintf(buf, "%s\n\r", argument); send_to_room_except(buf, ch->in_room, ch); send_to_char("Ok.\n\r", ch); *************** *** 1163,1167 **** void do_system(struct char_data *ch, char *argument, int cmd) { - int i; char buf[2256]; --- 947,950 ---- *************** *** 1171,1256 **** return; } ! for (i = 0; isspace(argument[i]); i++) { ! /* ! * Empty loop ! */ ! } ! if (!argument[i]) { send_to_char("That must be a mistake...\n\rTry arguments 1-8 (Info, " "Ann, Upd, sys, warn, reb, wel, note)\n\r", ch); ! } else { ! switch (argument[0]) { ! case '1': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RINFO$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '2': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RANNOUNCEMENT$c000Y=-$c000w " ! "%s\n\r$c000w", argument); ! break; ! case '3': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RUPDATE$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '4': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RSYSTEM$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '5': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RWARNING$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '6': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RREBOOT$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '7': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RWELCOME$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '8': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RNOTE$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! default: ! sprintf(buf, "%s\n\r", argument + i); ! break; ! } ! send_to_all(buf); } } --- 954,1037 ---- return; } ! ! argument = skip_spaces(argument); ! if (!*argument) { send_to_char("That must be a mistake...\n\rTry arguments 1-8 (Info, " "Ann, Upd, sys, warn, reb, wel, note)\n\r", ch); ! return; ! } ! switch (*argument) { ! case '1': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RINFO$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '2': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RANNOUNCEMENT$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '3': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RUPDATE$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '4': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RSYSTEM$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '5': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RWARNING$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '6': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RREBOOT$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '7': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RWELCOME$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! case '8': ! /* ! * Remove the number.. ! */ ! argument++; ! sprintf(buf, "$c000Y-=$c000RNOTE$c000Y=-$c000w %s\n\r$c000w", ! argument); ! break; ! default: ! sprintf(buf, "%s\n\r", argument); ! break; } + + send_to_all(buf); } *************** *** 2478,2488 **** free(j->name); } ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! strcpy(parmstr, argument); ! j->name = strdup(parmstr); return; } --- 2259,2264 ---- free(j->name); } ! argument = skip_spaces(argument); ! j->name = strdup(argument); return; } *************** *** 2492,2515 **** free(j->description); } ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! strcpy(parmstr, argument); ! j->description = strdup(parmstr); return; } if (!strcmp(field, "sdesc")) { if (j->short_description) { free(j->short_description); } ! for (; isspace(*argument); argument++) { ! /* ! * Empty loop ! */ ! } ! strcpy(parmstr, argument); ! j->short_description = strdup(parmstr); return; } --- 2268,2282 ---- free(j->description); } ! argument = skip_spaces(argument); ! j->description = strdup(argument); return; } + if (!strcmp(field, "sdesc")) { if (j->short_description) { free(j->short_description); } ! argument = skip_spaces(argument); ! j->short_description = strdup(argument); return; ... [truncated message content] |