Why wont this work.

Posted by BHawk on Tue 10 Aug 2004 04:17 AM — 4 posts, 15,730 views.

#0
Im using the latest AFKmud code base and Im having a little trouble with a snippet of code im trying to implement.

AFKmud allows for character creation to be done in game, but I wanted to hide the prompt while characters are in the creation area.'

I added this in the display_prompt function:

...
  if (ch->in_room->area->filename == "entry.are")
	  prompt = blankprompt;

  else if( !IS_PCFLAG( ch, PCFLAG_HELPSTART ) )
	prompt = helpstart;

... 


In case you cant tell, the if i added is right above the check to see if the helpstart prompt should be displayed.

I added a bug("%s", ch->in_room->area->filename); right before my code to make sure
ch->in_room->area->filename was indeed equal to "entry.are" and it was. Im not sure why the first if would be false other than theres maybe a difference in the strings that isnt printing to the screen (like a "\n"or something).
USA #1
Whats not working? The ifcheck, or the prompt declaration?
#2
sorry, i guess i wasnt clear, the if check isnt working. It skips the first if and goes to the else if even though ch->in_room->area->filename is equal to "entry.are"
USA #3
Ah, you have to use strcmp.

Change the ifcheck to this:

if( !strcmp(ch->in_room->area->filename, "entry.are") )