Yet another Lope Color Prob HELP PLZ :(

Posted by NeMeSiS on Mon 06 May 2002 09:05 PM — 4 posts, 18,887 views.

#0
ok i patched the code and changed the /e but i still have another error:

c:\windows\desktop\rom\src\comm.c(2473) : error C2084: function 'void __cdecl page_to_char(const char *,struct char_data *)' already has a body

how do i fix this? im running the win version of rom and compiling with visual C++ ive also tried using cygwin to make it and still get that error.


i notice in the source of comm.c theres 2 of these:

/*
* Send a page to one char.
*/
void page_to_char( const char *txt, CHAR_DATA *ch )
{
if ( txt == NULL || ch->desc == NULL)
return;

if (ch->lines == 0 )
{
send_to_char(txt,ch);
return;
}

#if defined(macintosh)
send_to_char(txt,ch);
#else
ch->desc->showstr_head = alloc_mem(strlen(txt) + 1);
strcpy(ch->desc->showstr_head,txt);
ch->desc->showstr_point = ch->desc->showstr_head;
show_string(ch->desc,"");
#endif
}

/*
* Page to one char, new colour version, by Lope.
*/
void page_to_char( const char *txt, CHAR_DATA *ch )
{
const char *point;
char *point2;
char buf[ MAX_STRING_LENGTH * 4 ];
int skip = 0;

#if defined(macintosh)
send_to_char( txt, ch );
#else
buf[0] = '\0';
point2 = buf;
if( txt && ch->desc )
{
if( IS_SET( ch->act, PLR_COLOUR ) )
{
for( point = txt ; *point ; point++ )
{
if( *point == '{' )
{
point++;
skip = colour( *point, ch, point2 );
while( skip-- > 0 )
++point2;
continue;
}
*point2 = *point;
*++point2 = '\0';
}
*point2 = '\0';
ch->desc->showstr_head = alloc_mem( strlen( buf ) + 1 );
strcpy( ch->desc->showstr_head, buf );
ch->desc->showstr_point = ch->desc->showstr_head;
show_string( ch->desc, "" );
}
else
{
for( point = txt ; *point ; point++ )
{
if( *point == '{' )
{
point++;
continue;
}
*point2 = *point;
*++point2 = '\0';
}
*point2 = '\0';
ch->desc->showstr_head = alloc_mem( strlen( buf ) + 1 );
strcpy( ch->desc->showstr_head, buf );
ch->desc->showstr_point = ch->desc->showstr_head;
show_string( ch->desc, "" );
}
}
#endif
return;
}



I see theres 2 sets with:

void page_to_char( const char *txt, CHAR_DATA *ch )


but i tried removing the old one no helpa nd tried remioving the new 1 still nothing when i remove either i get 25 errors when trying to compile again hehe plz help this poor newbie.
USA #1
Well. I don't have an answer for you but do you know what the __cdecl is right after the void? It would seem to me it is talking about something that says void __cdecl but I've never seen anything like that.. or is it just something that it sticks in there?

Sorry just wondering about that.

Creep
#2
its nowhere in the source and no where on the error line so its something v C++ adds. the error line is just a { which is weird i tried removing it to still nothing but more errors. any1 wanna be so kind as to post a link to a windows rom w/ olc and color already added? :) i know smaug has it but i dont like smaug 2 much. or if sum1 can help me with that error thx.
#3
paste the actual line that is at the line number that it's saying starts the error, that might give a better idea as to the cause.