Re: [NEWBIE][CODE] Simple Coding Question.

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 08/22/02


On Wed, Aug 21, 2002 at 07:48:35PM -0400, Justin Adler wrote:
>Hi Folks.
>
>   a very simple question here.
>
>If i have the following ....
>
>[pure@echobase src]$ grep "GET_SPELL_BEING_MEMORISED" *.h
>utils.h:432:#define GET_SPELL_BEING_MEMORISED(ch) (ch)->pc-
>>spell_being_memorised
>
>Only players (player structs) have a spell_being_memorised field.
>
>Now, if i have the following code ..
>if (!IS_NPC(victim) && GET_SPELL_BEING_MEMORISED(victim)) {
>...
>}
>
>is that bad coding form?  Like, the second argument above will CRASH for
>my mobs (my mobs ALL have *ch->pc == NULL, not the stock method).

Actually, that's good form, and with the change you made to ch->pc, it's
pretty much the required form.

-me

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT