Okie, I'm at a bit of a loss here

What I'm trying to do is assign a CHAR_DATA * spouse  field to a
player..
I've been fighting with this relationship bit for almost a year, but
still it's givin me problems. Just decided to take the time and fix it,
but I can't figure out for the life of me what I'm doing wrong.

Here's an example of how it's used:

In struct pc_data
CHAR_DATA               spouse;

Now, for a sample of how it's used.. 

void do_askout( CHAR_DATA *ch, char *argument)
{   
    char arg1[MAX_INPUT_LENGTH];
    char buf[MSL];
    CHAR_DATA *victim;
    argument = one_argument( argument, arg1 );
    
    if ( arg1[0] == '\0' )
    {
        send_to_char( "Who would you like to ask out on a
date?\n\r",ch);
        return;
    }
    if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
    {
        send_to_char( "They're not here.\n\r", ch );
        return;
    }
   if (IS_NPC(victim))
   {
         stc("Umm, Please, can we void mob dates! They get rather ugly
when they die\n\r",ch);
        return;
   }
   if (victim->pcdata->spouse)
   {
sprintf(buf,"I don't think %s would like that very much\n\r",
victim->pcdata->spouse);
        stc(buf,ch);
       return; 
   } 
   if (ch->pcdata->spouse)
   { 
        sprintf(buf,"I don't think %s would like that very much\n\r",
ch->pcdata->spouse); 
// Here I've got an invalid pointer?? Char format but CHAR_DATA arg????
.. I really really don't get this...
        stc(buf,ch);
       return;
   }
victim->pcdata->tspouse = ch->name ;
ch->pcdata->tspouse = victim->name ;
victim->pcdata->predating  = TRUE;
victim->pcdata->tspouse = ch->name ;
ch->pcdata->tspouse = victim->name ;
victim->pcdata->predating  = TRUE;
act( "You ask $M on a date", ch, NULL,victim, TO_CHAR );
act( "$n bows before you and asks you on a date.\n\rTo accept, type
{rconsent{x $n, to decline, type {rnoconse$
act( "$n bows before $N and asks $M on a date.",  ch, NULL, victim,
TO_NOTVICT );

}

I'm completely lost here.. What am I doing wrong???
I've tried using CHAR, but that screws  up if the char's not online
randomly, or if they lose link.. What I'm after is a pointer into the
actual person's name, nothing else..





Reply via email to