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 ➜ do_destroy, update clan

do_destroy, update clan

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


Posted by Zeno   USA  (2,871 posts)  Bio
Date Wed 09 Mar 2005 03:24 AM (UTC)
Message
Is there anyway for do_destroy to update the clan if they are in one? It needs to clan->members-- since they are destroyed. The delete snippet uses do_destroy, so I really need a way for this to work.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Wed 09 Mar 2005 04:49 AM (UTC)
Message
Does destroy load up the character data? If so, isn't it just a matter of getting their clan name, looking up the clan, reducing members by one, and that's all?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Wed 09 Mar 2005 11:02 AM (UTC)
Message
Nope it doesn't, that's why I'm asking. I'd be simple if I was able to use victim->pcdata->clan.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Wed 09 Mar 2005 05:28 PM (UTC)
Message
I should have guessed that it wouldn't be so simple. :P

Well, in that case you're going to have to open up the pfile and find the clan name. Isn't there a reduced character-opener that is used e.g. for the last command? You could always use load_char_obj or whichever function it is, just make sure you dispose of the char_data afterwards.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Wed 09 Mar 2005 06:50 PM (UTC)

Amended on Wed 09 Mar 2005 06:57 PM (UTC) by Zeno

Message
Not that I know of.
void do_last( CHAR_DATA *ch, char *argument )
{
    char buf [MAX_STRING_LENGTH];
    char arg [MAX_INPUT_LENGTH];
    char name[MAX_INPUT_LENGTH];
    struct stat fst;

    one_argument( argument, arg );
    if ( arg[0] == '\0' )
    {
        send_to_char( "Usage: last <playername>\n\r", ch );
        return;
    }
    strcpy( name, capitalize(arg) );
    sprintf( buf, "%s%c/%s", PLAYER_DIR, tolower(arg[0]), name );
    if ( stat( buf, &fst ) != -1 && check_parse_name( capitalize(name), FALSE ))
      sprintf( buf, "%s was last on: %s\r", name, ctime( &fst.st_mtime ) );
    else
      sprintf( buf, "%s was not found.\n\r", name );
   send_to_char( buf, ch );
}


I'll just look over how loadup works.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Wed 09 Mar 2005 07:58 PM (UTC)
Message
Oh. The version of last on my MUD must have been extended. It loads up the pfile only partially, scanning for level, so that you can't use 'last' on somebody higher level than you.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.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.


13,017 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.