Re: [CODE] text based alignment

From: Peter d (death_comes_to_all@hotmail.com)
Date: 06/27/02


>well if align was declared as std::string then yes it's legal but thats
>C++ and not C.
>
>Ron
>

I actually solved the problem yesterday.. so there is no need to reply
anymore to this mail, thanx for the assistance :)
i solved it like this..

i added char align[MAX_INPUT_LENGTH]; at the top of the line, in case i want
to add it to other functions.

if ((GET_ALIGNMENT(ch) >= 750) && !IS_NPC(ch))
        strcpy(align,"Saintly");
  else if (GET_ALIGNMENT(ch) < 750 && GET_ALIGNMENT(ch) > 500 &&
!IS_NPC(ch))
        strcpy(align,"Beatific");
  else if (GET_ALIGNMENT(ch) < 500 && GET_ALIGNMENT(ch) > 250 &&
!IS_NPC(ch))
        strcpy(align,"Good");
  else if (GET_ALIGNMENT(ch) < 250 && GET_ALIGNMENT(ch) > -250 &&
!IS_NPC(ch))
        strcpy(align,"Neutral");
  else if (GET_ALIGNMENT(ch) < -250 && GET_ALIGNMENT(ch) > -500 &&
!IS_NPC(ch))
        strcpy(align,"Evil");
  else if (GET_ALIGNMENT(ch) < -500 && GET_ALIGNMENT(ch) > -750 &&
!IS_NPC(ch))
        strcpy(align,"Diabolic");
  else if (GET_ALIGNMENT(ch) < -750 && !IS_NPC(ch))
        strcpy(align,"Demonic");

It works like a charm.
i had to change the range of IS_GOOD and IS_EVIL so that it would fit me..

//Peter

_________________________________________________________________
MSN Foto är det enklaste sättet att dela eller skaffa papperskopior av dina
foton: http://photos.msn.com/support/worldwide.aspx

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT