Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ get_extra_descr difficulties

get_extra_descr difficulties

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Llarn   (23 posts)  Bio
Date Sat 20 Sep 2008 02:46 AM (UTC)
Message
I cant seem to bend extra_descr to my will. Anyone see
what could be causing it to crash on this?


sprintf( extra_buf, "This item bears the seal of %s, the %s smith.",
ch->name,
ch->pcdata->learned[gsn_forge] <= 50 ? "apprentice" :
ch->pcdata->learned[gsn_forge] <= 75 ? "journeyman" :
ch->pcdata->learned[gsn_forge] == 100 ? "master" : "reknowned" );
item->name = STRALLOC( name_buf );
item->short_descr = STRALLOC( short_buf );
item->description = STRALLOC( long_buf );
get_extra_descr( STRALLOC( extra_buf ), item->first_extradesc);
if(VLD_STR(item->first_extradesc->keyword))
item->first_extradesc->keyword = STRALLOC(item->name);
item->last_extradesc = NULL;


#0 0x080d06cb in do_forge (ch=0x939bf08,
argument=0x8427f20 "X «\b\210&¦\b¨Ý¼\b0Î4\t\20025\t\030HJ\t ¶:\t\210¶:\t@®C\tð¸3\tØÛ*\t\020±C\tø©2\t(±C\t\220oM\tp.N\t\020¶2\t\210ã7\tÐ,N\tð¤C\t è7\t°oM\tpB@\tð\0202\tH.N\t¸\2327\t\200¯C\t\220¬@\tP\b5\tà@S\t\030^3\t\210½C\t\030ª2\t\230úL\tàµ2\t\210RD\t\230¦C\tÀùC\tHy+\tHÃ9\t\020AS\t") at crafts.c:722
722 if(VLD_STR(item->first_extradesc->keyword))
(gdb) print argument
$1 = 0x8427f20 "X «\b\210&¦\b¨Ý¼\b0Î4\t\20025\t\030HJ\t ¶:\t\210¶:\t@®C\tð¸3\tØÛ*\t\020±C\tø©2\t(±C\t\220oM\tp.N\t\020¶2\t\210ã7\tÐ,N\tð¤C\t è7\t°oM\tpB@\tð\0202\tH.N\t¸\2327\t\200¯C\t\220¬@\tP\b5\tà@S\t\030^3\t\210½C\t\030ª2\t\230úL\tàµ2\t\210RD\t\230¦C\tÀùC\tHy+\tHÃ9\t\020AS\t"
Current language: auto; currently c++
(gdb) print keyword
No symbol "keyword" in current context.
(gdb) print first_extradesc->keyword
No symbol "first_extradesc" in current context.
(gdb) print item->first_extradesc->keyword
Cannot access memory at address 0x8
Top

Posted by ThomasWatts   USA  (66 posts)  Bio
Date Reply #1 on Sat 20 Sep 2008 07:39 PM (UTC)
Message
Instead of STRALLOC, perhaps you want STRDUPE.
Top

Posted by Llarn   (23 posts)  Bio
Date Reply #2 on Sat 20 Sep 2008 09:21 PM (UTC)
Message
I got it. someone told me had to create it first.

EXTRA_DESCR_DATA *ed;

CREATE( ed, EXTRA_DESCR_DATA, 1 );
LINK( ed, item->first_extradesc, item->last_extradesc, next, prev );
ed->keyword = STRALLOC( item->name );
ed->description = STRALLOC( extra_buf );
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,436 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.