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
➜ Area Editor
➜ General
➜ SmaugFUSS + Area Editor
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
| Posted by
| Nick Gammon
Australia (23,169 posts) Bio
Forum Administrator |
| Date
| Reply #15 on Wed 22 Mar 2006 05:49 AM (UTC) |
| Message
| I am working on expressing the saving of resets in fold_area more simply, but compatible with what it currently does. Right now it doesn't work, time to fire up gdb. :)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,169 posts) Bio
Forum Administrator |
| Date
| Reply #16 on Wed 22 Mar 2006 06:11 AM (UTC) |
| Message
| Well this seems to work. I can't claim the area files are identical afterwards, but that seems to be because the mob progs change their sequence. However the resets seem to match. This is the recursive reset-saver:
void save_reset_level (FILE * fpout, RESET_DATA * start_reset, const int level)
{
int spaces = level * 2;
RESET_DATA * reset;
for( reset = start_reset; reset; )
{
switch ( UPPER (reset->command) ) /* extra arg1 arg2 arg3 */
{
case '*':
break;
default:
fprintf( fpout, "%*.sR %c %d %d %d %d\n", spaces, "",
UPPER( reset->command ),
reset->extra, reset->arg1, reset->arg2, reset->arg3 );
break;
case 'G':
case 'R':
fprintf( fpout, "%*.sR %c %d %d %d\n", spaces, "",
UPPER( reset->command ), reset->extra, reset->arg1, reset->arg2 );
break;
} /* end of switch on command */
/* recurse to save nested resets */
save_reset_level (fpout, reset->first_reset, level + 1);
/* where we go next depends on if this is a top-level reset or not - for some reason */
if (level == 0)
reset = reset->next;
else
reset = reset->next_reset;
} /* end of looping through resets */
} /* end of save_reset_level */
And you replace the reset saving stuff with this line:
save_reset_level (fpout, room->first_reset, 0);
Basically that kicks off saving the first level of resets, and the function above saves the subsequent levels.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Samson
USA (683 posts) Bio
|
| Date
| Reply #17 on Wed 22 Mar 2006 10:26 AM (UTC) |
| Message
| | Very nice. Very nice indeed. I'll have to play with that once I get to work. | | Top |
|
| Posted by
| Conner
USA (381 posts) Bio
|
| Date
| Reply #18 on Wed 22 Mar 2006 09:09 PM (UTC) |
| Message
| | That does look pretty slick, Nick. Nicely done. :) |
-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org | | 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.
81,534 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top