Re: [CODE] Small Problem

From: Rasmus 'Con' Ronlev (
Date: 10/03/96

On Wed, 2 Oct 1996, Brian Guilbault wrote:

> Well, apparently gcc tells me that "victim" might be used uninitialized in
> levels correctly, etc). I don't know what's wrong because I've written
>   struct char_data *victim;
>   one_argument(argument, arg);
>   if (!*arg) {
>     send_to_char("Who do you want to zap?\r\n", ch);
>     return;
>   }
>   if (IS_NPC(victim)) {
>     send_to_char("You can't zap a mob!\r\n", ch);
>     return;

Well, you never get to assign victim to anything at all!

You need to do a:

if (!(vict = get_char_vis(ch, arg))
 send_to_char("Better supply a victim, or should you be fried ??\r\n",ch);

Something like that, and put it BEFORE the IS_NPC(victim) check..


     Rasmus Rønlev DOEK'94      WWW:
     Student instructor         MUD: 5000
       Student, B.Sc in Computer Science and Business Administration.

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

This archive was generated by hypermail 2b30 : 12/18/00 PST