13 Jul, 2012, tobiasbrognan wrote in the 1st comment:
Votes: 0
I don't see that I'm missing anything, any ideas?

case CON_QCLASS:
load_result = parse_class(*arg);
if (load_result == CLASS_UNDEFINED) {
write_to_output(d, "\r\nThat's not a class.\r\nClass: ");
return;
} else
GET_CLASS(d->character) = load_result;

if (d->olc) {
free(d->olc);
d->olc = NULL;

}
write_to_output(d, "%s\r\nPick a hair style: ", hairstyle_menu);
STATE(d) = CON_QHAIRSTYLE;
break;

case CON_QHAIRSTYLE:
load_result = parse_hairstyle(*arg);
if (load_result == HAIRSTYLE_UNDEFINED) {
write_to_output(d, "\r\nThat's not a valid hair style.\r\nPick a hair style: ");
return;
} else
GET_HAIRSTYLE(d->character) = load_result; /**** LINE 1645 ****/

if (GET_PFILEPOS(d->character) < 0)
GET_PFILEPOS(d->character) = create_entry(GET_PC_NAME(d->character));
/* Now GET_NAME() will work properly. */


interpreter.c:1645: error: expected ')' before ';' token
interpreter.c:1823: error: expected ';' before '}' token
13 Jul, 2012, KaVir wrote in the 2nd comment:
Votes: 0
Missing { between line 23 and 24.

Looks like there should also be a { between lines 6 and 7, and a } on line 12. Although as you're returning within the if statement, the else isn't technically necessary.
13 Jul, 2012, Davion wrote in the 3rd comment:
Votes: 0
Also, please post your GET_HAIRSTYLE() macro. should be in a .h file
13 Jul, 2012, Liko wrote in the 4th comment:
Votes: 0
Your GET_HAIRSTYLE() marco will be in utils.h
13 Jul, 2012, tobiasbrognan wrote in the 5th comment:
Votes: 0
I added the curly's where you said and I still get the exact same errors.
13 Jul, 2012, tobiasbrognan wrote in the 6th comment:
Votes: 0
The only thing I have in utils.h is a define

#define GET_HAIRSTYLE(ch) ((ch->player.hairstyle)

Doh and I just noticed after I posted this I am missing a )

Lets see if that does anything
13 Jul, 2012, tobiasbrognan wrote in the 7th comment:
Votes: 0
That seemed to get it. I just started working on mud code again after a few years break so I am rusty. Thanks
13 Jul, 2012, tobiasbrognan wrote in the 8th comment:
Votes: 0
It's weird really, I added some more hairstyles after a clean compile, and now im getting more errors. Considering what I added I don't see where they are coming from.


hairstyles.c:62: error: expected declaration specifiers before 'arg'
hairstyles.c:64: error: expected declaration specifiers before 'switch'
hairstyles.c:88: error: expected declaration specifiers before '}' token
hairstyles.c:88: error: expected '{' at end of input

const char *pc_hairstyle[] = {

"Afro",
"Bald",
"Buzz Cut",
"Caesar",
"Comb Over",
"Cornrows",
"Crew Cut",
"Cropped",
"Curly",
"Dreadlocks",
"Fauxhawk",
"Flat Top",
"French Braid",
"High and Tight",
"Mohawk",
"Mop Top",
"Mullet",
"Pigtails",
"Pompadour",
"Straight",

"\n"
};

const char *hairstyle_menu =
"\r\n"
"Choose your hair style:\r\n"
" [A] - Afro\r\n"
" [B] - Bald\r\n"
" [C] - Buzz Cut\r\n"
" [D] - Caesar\r\n"
" [E] - Comb Over\r\n"
" [F] - Cornrows\r\n"
" [G] - Crew Cut\r\n"
" [H] - Cropped\r\n"
" [I] - Curly\r\n"
" [J] - Dreadlocks\r\n"
" [K] - Fauxhawk\r\n"
" [L] - Flat Top\r\n"
" [M] - French Braid\r\n"
" [N] - High and Tight\r\n"
" [O] - Mohawk\r\n"
" [P] - Mop Top\r\n"
" [Q] - Mullet\r\n"
" [R] - Pigtails\r\n"
" [S] - Pompadour\r\n"
" [T] - Straight\r\n";

int parse_hairstyle(char arg)

arg = LOWER(arg);

switch (arg)
{
case 'a': return HAIRSTYLE_AFRO;
case 'b': return HAIRSTYLE_BALD;
case 'c': return HAIRSTYLE_BUZZ_CUT;
case 'd': return HAIRSTYLE_CAESAR;
case 'e': return HAIRSTYLE_COMB_OVER;
case 'f': return HAIRSTYLE_CORNROWS;
case 'g': return HAIRSTYLE_CREW_CUT;
case 'h': return HAIRSTYLE_CROPPED;
case 'i': return HAIRSTYLE_CURLY;
case 'j': return HAIRSTYLE_DREADLOCKS;
case 'k': return HAIRSTYLE_FAUXHAWK;
case 'l': return HAIRSTYLE_FLAT_TOP;
case 'm': return HAIRSTYLE_FRENCH_BRAID;
case 'n': return HAIRSTYLE_HIGH_AND_TIGHT;
case 'o': return HAIRSTYLE_MOHAWK;
case 'p': return HAIRSTYLE_MOP_TOP;
case 'q': return HAIRSTYLE_MULLET;
case 'r': return HAIRSTYLE_PIGTAILS;
case 's': return HAIRSTYLE_POMPADOUR;
case 't': return HAIRSTYLE_STRAIGHT;
default : return HAIRSTYLE_UNDEFINED;
}
}
13 Jul, 2012, tobiasbrognan wrote in the 9th comment:
Votes: 0
Yet again was missing a {

Thank you for your help.

=0)
13 Jul, 2012, Liko wrote in the 10th comment:
Votes: 0
int parse_hairstyle(char arg)
{
arg = LOWER(arg);
switch (arg)
{
case 'a': return HAIRSTYLE_AFRO;
case 'b': return HAIRSTYLE_BALD;
case 'c': return HAIRSTYLE_BUZZ_CUT;
case 'd': return HAIRSTYLE_CAESAR;
case 'e': return HAIRSTYLE_COMB_OVER;
case 'f': return HAIRSTYLE_CORNROWS;
case 'g': return HAIRSTYLE_CREW_CUT;
case 'h': return HAIRSTYLE_CROPPED;
case 'i': return HAIRSTYLE_CURLY;
case 'j': return HAIRSTYLE_DREADLOCKS;
case 'k': return HAIRSTYLE_FAUXHAWK;
case 'l': return HAIRSTYLE_FLAT_TOP;
case 'm': return HAIRSTYLE_FRENCH_BRAID;
case 'n': return HAIRSTYLE_HIGH_AND_TIGHT;
case 'o': return HAIRSTYLE_MOHAWK;
case 'p': return HAIRSTYLE_MOP_TOP;
case 'q': return HAIRSTYLE_MULLET;
case 'r': return HAIRSTYLE_PIGTAILS;
case 's': return HAIRSTYLE_POMPADOUR;
case 't': return HAIRSTYLE_STRAIGHT;
default : return HAIRSTYLE_UNDEFINED;
}
}
14 Jul, 2012, tobiasbrognan wrote in the 11th comment:
Votes: 0
When I try to add this to a function like score or whois and use %s for string and GET_HAIRSTYLE it tries to tell me that it wants an int value. Is this caused by something in my array?
14 Jul, 2012, Liko wrote in the 12th comment:
Votes: 0
pc_hairstyle[(int)GET_HAIRSTYLE(ch)]);


Try that
14 Jul, 2012, tobiasbrognan wrote in the 13th comment:
Votes: 0
For some reason when I set my hairstyle with do_set , it's always picking the next in line :P
14 Jul, 2012, Rarva.Riendf wrote in the 14th comment:
Votes: 0
You probably forgot that an array start at 0 and not 1…
14 Jul, 2012, tobiasbrognan wrote in the 15th comment:
Votes: 0
I added an undefined to the beginning of my array and that does fine. All of them line up now. Now to track down why it isn't saving over a reboot and I'll be good to go. =0)
14 Jul, 2012, Runter wrote in the 16th comment:
Votes: 0
I'm not certain from reading it that you are missing curly braces in the first place. Would need more code to know that. It could be just incoherent formatting.
15 Jul, 2012, tobiasbrognan wrote in the 17th comment:
Votes: 0
The whole thing about missing curly's was from an earlier problem. The only thing not functioning properly right now is it is not saving over a copyover/quit. It is defaulting.
15 Jul, 2012, tobiasbrognan wrote in the 18th comment:
Votes: 0
All problems solved now. Everything working good. Thank you for input.
15 Jul, 2012, Liko wrote in the 19th comment:
Votes: 0
Show me what you added to your pfdefaults.h and players.c

oops seems the problem is fixed now
0.0/19