to make casting quicker for those without clients, i went about changing the cast command, to just accept the second arguement as the spell to cast, basically i just reassigned the s and t variables in do_cast, it worked fine except when a spell has two words and the first word is the same, such as detect invisibility and detect alignment, it will only cast the first occurance in the list, since it will take the second part as the target of the spell, for example c detect invisibility gets interpreted as... cast detect alignment on a target named invisibility so to fix this, i went into the char *spells[]= and changed the names of detect alignment and detect invisibility to detect-alignment detect-invisibility so that they would be treated as one arguement, now this has called a problem for as soon as i type c detect the game hangs, apparently in an infinite loop in spell_parser.c ACMD(do_cast) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; struct char_data *tch = NULL; struct obj_data *tobj = NULL; char *s, *t; int mana, spellnum, i, target = 0; if (IS_NPC(ch)) return; /* i commented out the strtok stuff */ /* get: blank, spell name, target name */ /* s = strtok(argument, "'"); BUNCH OF STUFF HERE SNIPPED OUT } t = strtok(NULL, "\0"); */ /*end of commented out stuff */ two_arguments(argument, arg1, arg2); s = arg1; /* spellnum = search_block(s, spells, 0); */ spellnum = find_skill_num(s); SKIP DOWN TO /* Find the target */ if (t != NULL) { /* one_argument(strcpy(arg, t), t); skip_spaces(&t); */ t = arg2; } +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST