Re: [CODE] Setting alignment upon start

From: Leonardo Herrera (leonardo.herrera@mercantil.com)
Date: 03/17/01


flawed wrote:
>
> At the moment Im using an ethos system from the ftp site. It allows
> a player to pick an ethos (alignment) good, neutral, and evil.
> The problem is no matter what the player picks, the alignment
> always stays at 0.
>
> This was added in the con state for the ethos:
>
>       switch (GET_ETHOS(d->character))
>         {
>                 case 'a': case 'A':
>                         GET_ALIGNMENT(d->character) = 1000;
>                 case 'b': case 'B':
>                         GET_ALIGNMENT(d->character) = 0;
>                 case 'c': case 'C':
>                         GET_ALIGNMENT(d->character) = -1000;
>         }
>
> This however doesnt set the players alignment. Any ideas on what to try?

You forgot to add 'break' statements.

switch (GET_ETHOS(d->character))
{
        case 'a': case 'A':
                GET_ALIGNMENT(d->character) = 1000;
                break;
        case 'c': case 'C':
                GET_ALIGNMENT(d->character) = -1000;
                break;
        default:
                GET_ALIGNMENT(d->character) = 0;
                break;
}

However, from your piece of code, the alignment should always be -1000.
Probably you have another issue with your code.

--
Leonardo Herrera
mailto:leonardo.herrera@mercantil.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST