> ack! bad :)
>
>> sprintf(buf, "[Announcement by $n] Player %s and Player %s have done
>> something", victim1->name, victim2->name);
>>
>> act_new(buf, ch, NULL, NULL, TO_ALL, POS_DEAD);
>>
>> Other than that, I'm not sure what you're trying to do...
>
> You should never dereference '->name' directly unless it's an immortal.
> If you do, your players lose the benefits of invisibility and
> blindness. If you have to refer to a player, and act won't cut it, use
> PERS.

I agree, I also hacked my act_string stuff to add a lot more variables to
do things.

> ----------------------
> sprintf(buf, "[Announcement] Player %s and Player %s have done
> something", PERS(victim, ch), PERS(victim2, ch));
>
> act_new(buf, ch, NULL, NULL, TO_ALL, POS_DEAD);
> ------------------------

Problem is the odds are an immortal would have run this function.. so PERS(
victim, ch) is going to give the real name anyways, since immortals can see
all..  but since he didn't say what he was trying to do.. I guessed that it
would be run by an immortal command.. if it isn't going to be run by an
immortal.. it's much harder to do.

>
> I know it was just sample code, but implies bad practice :)
> Jason, who has a 60 line PERS() function.

Grin.. my PERS is very extensive also.. greet code makes it a LOT of fun..

Jef





Reply via email to