A correction I think needs to be made here:
/*
* Connected state for a channel.
*/
typedef enum
{
CON_PLAYING, CON_GET_NAME, CON_GET_OLD_PASSWORD,
CON_CONFIRM_NEW_NAME, CON_GET_NEW_PASSWORD, CON_CONFIRM_NEW_PASSWORD,
CON_GET_NEW_SEX, CON_READ_MOTD,
CON_GET_NEW_RACE, CON_GET_EMULATION, CON_EDITING,
CON_GET_WANT_RIPANSI, CON_TITLE, CON_PRESS_ENTER,
CON_WAIT_1, CON_WAIT_2, CON_WAIT_3,
CON_ACCEPTED, CON_GET_PKILL, CON_READ_IMOTD,
CON_GET_NEW_EMAIL, CON_GET_MSP, CON_GET_NEW_CLASS,
CON_ROLL_STATS, CON_STATS_OK
} connection_types;
Add the con stats and the = to make it look like this:
/*
* Connected state for a channel.
*/
typedef enum
{
CON_GET_NAME = -99, CON_GET_OLD_PASSWORD,
CON_CONFIRM_NEW_NAME, CON_GET_NEW_PASSWORD, CON_CONFIRM_NEW_PASSWORD,
CON_GET_NEW_SEX, CON_READ_MOTD,
CON_GET_NEW_RACE, CON_GET_EMULATION,
CON_GET_WANT_RIPANSI, CON_TITLE, CON_PRESS_ENTER,
CON_WAIT_1, CON_WAIT_2, CON_WAIT_3,
CON_ACCEPTED, CON_GET_PKILL, CON_READ_IMOTD,
CON_GET_NEW_EMAIL, CON_GET_MSP, CON_GET_NEW_CLASS,
CON_ROLL_STATS, CON_STATS_OK, CON_COPYOVER_RECOVER,
CON_PLAYING = 0, CON_EDITING
} connection_types;
In your instructions you have CON_EDITING unspecified after CON_GET_NAME is set to -99. Due to how enumerations work, it won't be > 0 as you were probably hoping it would.
When you set a value in an enum, every value which follows it will be +1 more than the one before it. Where you have it now it would come out as -90 and not +1 like it should be. CON_EDITING isn't likely to be true for anyone in the chargen sequence of a stock SWR or Smaug. Also not sure where your CON_ROLL_STATS and CON_STATS_OK fit in, but if those should be > 0 they need to be moved as well. |