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
➜ Quest.c
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Gregar
(20 posts) Bio
|
Date
| Mon 09 Feb 2004 10:39 AM (UTC) |
Message
| I have recently added first the quest snippet from Aurora at Lost Prophecies, and then removed that and used the quest snippet from Vassago.
Both compiled after some tweaks and booted up the game fine.
The addition of either quest snippet caused the MUD to crash when logging in pre-quest characters. However, new character gen works fine, up until the new character quits, at which point the MUD crashes.
Has anyone else had this problem when applying the questmaster snippets?
Gregar | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #1 on Mon 09 Feb 2004 03:36 PM (UTC) |
Message
| I beleive I know the problem: When you log in, your character is loaded to check the password, and then is cleared away. It is then re-loaded fully later to allow you to play. To clear away the memory used from the first load, it uses a function called free_char. This is also called when a player quits, but not when you make a new character. I would suggest looking at free_char. Make sure any information that is being read in with fread_string is cleared away with STRALLOC, and anything read in with fread_string_nohash is cleared with DISPOSE.
KEY(Quest, ch->questmaster, fread_string);
STRFREE(ch->questmaster);
As opposed to:
KEY(Quest, ch->questmaster, fread_string_nohash);
DISPOSE(ch->questmaster);
Hope that helps. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Gregar
(20 posts) Bio
|
Date
| Reply #2 on Mon 09 Feb 2004 08:47 PM (UTC) Amended on Mon 09 Feb 2004 08:51 PM (UTC) by Gregar
|
Message
| Just to clarify before I mess this up any further..
What I have added, per the snippet, are these lines of code to save.c, fread_char function
case 'Q':
KEY( "QuestPnts", ch->questpoints, fread_number( fp ) );
KEY( "QuestNext", ch->nextquest, fread_number( fp ) );
break;
I see fread_number, and did not add anything with fread_string, so my question comes more for clarification.
Does the fread_number need to be declared in db.c at free_char, and if so, I am presuming it would be;
if (ch->pcdata->questpnts)
STRFREE(ch->pcdata->questpoints);
if (ch->pcdata->questnext)
STRFREE(ch->pcdata->nextquest);
or am I just off somewhere that nooone should tread?
Thanks in advance.
Gregar | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #3 on Tue 10 Feb 2004 12:59 AM (UTC) |
Message
| Heh, you only need to use STRFREE/DISPOSE on strings, if you've added only inegers, you don't need to work about it.
I would check your core, see whats coming up. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Rash
United Kingdom (56 posts) Bio
|
Date
| Reply #4 on Sat 06 Mar 2004 11:29 AM (UTC) |
Message
| Just a quick question on Vassago's Quest snippet...
I see you have it working... i have a problem in the compile of:
quest.c: In function 'generate_quest':
quest.c:486: error: 'char_list' undeclared (first use in this function.)
quest.c:486: error: (Each undeclared identify is reported only once
quest.c:486: error: for each function it appears in)
make[1]: *** [quest.o] Error 1
Any ideas behind this one? | Top |
|
Posted by
| Gregar
(20 posts) Bio
|
Date
| Reply #5 on Sun 07 Mar 2004 01:22 AM (UTC) |
Message
| At a glance I would vote you are missing this declaration..
void generate_quest args(( CHAR_DATA *ch, CHAR_DATA *questman ));
Somewhere around line 40.
Then the first line of the function, on my working copy, (your line 486) reads as follows;
void generate_quest(CHAR_DATA *ch, CHAR_DATA *questman)
I don't know if this is any help, but thats how it works for us.
| Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #6 on Sun 07 Mar 2004 07:46 AM (UTC) |
Message
|
Quote:
quest.c: In function 'generate_quest':
quest.c:486: error: 'char_list' undeclared (first use in this function.)
quest.c:486: error: (Each undeclared identify is reported only once
quest.c:486: error: for each function it appears in)
make[1]: *** [quest.o] Error 1
These generally means that its using an undefined variable within the function. Simply go to the top and define it. Not sure the variable type, but I'm going to guess this:
CHAR_DATA *char_list;
Then again, that might be wrong. To be safe (if you are unsure about what to do) post the lines 480-490 so we can see what char_list is used for. |
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| Rash
United Kingdom (56 posts) Bio
|
Date
| Reply #7 on Sun 07 Mar 2004 01:11 PM (UTC) |
Message
| It okay i figured out what the problem was.
char_list is ROM's way of going throught the characters/mobs in a room. So i changed it to first_char
and it works fine now. Everything going clean and working fine. Iv just got add a few if checks to stop the quest guys giving quests to hell and limbo :-p
Rash | 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.
21,481 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top