Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot, Bing

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » Small annoyance with backup p...
Forum Rules | Mark all | Recent Posts

Small annoyance with backup pfiles:
< Newer Topic :: Older Topic > A better way to restorefile!

Pages:<< prev 1 next >>
Post is unread #1 Jun 19, 2009, 2:16 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

So ever since the dawn of FotE - or something - I don't know the history all that well... I just say FotE cause that is what I work with. When a player died, a backup of their pfile was saved in the backup directory. It was mostly good. However, as more and more deaths were ruled accidents, code errors, or just out right silliness; it became a pain in the butt to restore them to their former selves.

So, with the help of one called Keberus, I/we give you this. What this does is let you kill em to your hearts desire and restore them with all their eq.

In fight.c function OBJ_DATA *raw_kill() find:
    if( !IS_NPC( victim ) || ( !IS_SET( victim->act, ACT_NOKILL ) && !IS_SET( victim->act, ACT_NOCORPSE ) ) )
        corpse_to_return = make_corpse( victim, IS_NPC( ch ) ? ch->short_descr : ch->name );


And just before that if add in:
    sprintf( buf, "%s%c/%s", PLAYER_DIR, tolower( arg[0] ), capitalize( arg ) );
    sprintf( buf2, "%s%c/%s", BACKUP_DIR, tolower( arg[0] ), capitalize( arg ) );
    rename( buf, buf2 );


Now lets go to the bottom of the function and remove these lines:
    sprintf( buf, "%s%c/%s", PLAYER_DIR, tolower( arg[0] ), capitalize( arg ) );
    sprintf( buf2, "%s%c/%s", BACKUP_DIR, tolower( arg[0] ), capitalize( arg ) );
    rename( buf, buf2 );


Right about the comment Profile Deletion add in
   rename( buf, buf2 );


Now, their corpse will still drop everything its supposed to, but it will also be saved in the backup folder. I don't know about you all, but nothing worse than naked players running around.
       
Pages:<< prev 1 next >>