On Wed, 22 Apr 1998, ;P wrote:
>ACMD(do_call)
>{
> int i, skill, duration, mob_vnum = -1;
> int new_mana = GET_MANA(ch);
> struct caller_event_obj *ev_o;
> struct char_data *mob;
>
> struct caller_info {
You don't have to name the structure since it's not used elsewhere.
> char *name;
> int skill_num;
> int mob_num;
> } creatures[] = {
> { "chocabo", SPELL_CALL_CHOC, 1297 },
I believe that is spelled, 'chocobo'. (I've been playing waaaay too much
FF2 lately.)
> { "imp", SPELL_CALL_IMP, 1298 },
> { "\n", -1}
> };
>
> one_argument(argument, arg);
>
> for (i = 0; creatures[i] == "\n"; i++)
Should be '\n', and you'd probably want 'creatures[i].name'
> if (!str_cmp(arg, creatures[i].name)) {
> skill = creatures[i].skill;
> mob_vnum = creatures[i].mob_num;
> }
You should add a 'break;' in there since you shouldn't match more than one
anyway.
> if (!GET_SKILL(ch, skill)) {
> send_to_char("You don't know how to call that creature.\r\n", ch);
> return;
> }
Should probably move this check up since they can't call anyway.
> mob = read_mobile(mob_num, VIRTUAL);
You didn't check for a NULL mobile. It could happen if that mob doesn't
exist in the database, such as for mini-mud mode.
--
George Greer - Me@Null.net | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard
+------------------------------------------------------------+
| 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/15/00 PST