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 ➜ Why wont this work.

Why wont this work.

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


Posted by BHawk   (6 posts)  Bio
Date Tue 10 Aug 2004 04:17 AM (UTC)
Message
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).
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Tue 10 Aug 2004 04:53 AM (UTC)
Message
Whats not working? The ifcheck, or the prompt declaration?

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

Posted by BHawk   (6 posts)  Bio
Date Reply #2 on Tue 10 Aug 2004 05:17 AM (UTC)
Message
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"
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Tue 10 Aug 2004 05:20 AM (UTC)

Amended on Tue 10 Aug 2004 05:41 AM (UTC) by Zeno

Message
Ah, you have to use strcmp.

Change the ifcheck to this:

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

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.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.


14,960 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.