>From: Peter Ajamian <pajamian@CHEAPSAM.COM>
>Reply-To: Circle Discussion List <CIRCLE@post.queensu.ca>
>To: CIRCLE@post.queensu.ca
>Subject: Re: char_player_data problem, again...
>Date: Thu, 23 Sep 1999 22:27:12 -0700
>
>Zeavon wrote:
>
> > I could be wrong, but I bet you have something like:
> > ch->titlea = "with a big nose"
> > OR
> > ch->titlea = argument;
>
>Actually, these lines will not cause a seg fault, the first line will
>simply
>have the compiler create a string constant and set the ch->titlea pointer
>to
>point to it, the second line will simply point ch->titlea to the same
>string as
>argument (this may cause a problem later, though, if argument is a local
>variable and a read attempt on ch->title is attempted from another
>function).
>
>I'm guessing that you probably meant to give an example like the
>following...
>
>strcpy(ch->titlea, "with a big nose");
>
>strcpy(ch->titlea, argument);
>
>If ch->titlea has not first been set to point to a properly allocated area
>of
>memory this will almost always cause some type of problem and usually end
>up
>causing a seg. fault.
>
>Regards,
>
>Peter
>
----------------------------------------------------------------
This is how i have dont it now:
as the characer is created they chose some stuff like
eyecolor...
now i did like this:
d->character->player.descb = "with brown eyes";
and added char *descb to char_player_data
this do not crash the game when i use the olc.
did same thing for *descc,
but when trying to add another one, called desca
the game crashes when using olc.
same thing if i add the afk snippet,
which adds a message to char_player_data
the game crashed when using olc.
how can descb descc work?
if the other stuff i add to char_player_data dont..
the thing desca was exactly the same as descb and descc,
so it seems odd this fails.
shrug
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST