Define and use NATID_BAD instead of literal 255

This commit is contained in:
Markus Armbruster 2008-02-19 20:25:08 +01:00
parent 00bb086d2a
commit 8d4b959a0c
4 changed files with 7 additions and 4 deletions

View file

@ -39,6 +39,8 @@
#include <time.h>
#include "types.h"
#define NATID_BAD 255
#define MAXNOR 50 /* max # realms */
/* Nation status */

View file

@ -47,6 +47,7 @@
#include "empthread.h"
#include "file.h"
#include "misc.h"
#include "nat.h"
#include "optlist.h"
#include "player.h"
#include "power.h"
@ -84,7 +85,7 @@ player_new(int s)
return NULL;
}
emp_insque(&lp->queue, &Players);
lp->cnum = 255;
lp->cnum = NATID_BAD;
lp->curid = -1;
time(&lp->curup);
}

View file

@ -207,7 +207,7 @@ pass_cmd(void)
{
if (!player->argp[1])
return RET_SYN;
if (player->cnum == 255) {
if (player->cnum == NATID_BAD) {
pr_id(player, C_CMDERR, "need country first\n");
return RET_FAIL;
}
@ -280,7 +280,7 @@ may_play(void)
{
struct natstr *np;
if (player->cnum == 255 || !player->authenticated) {
if (player->cnum == NATID_BAD || !player->authenticated) {
pr_id(player, C_CMDERR, "need country and password\n");
return 0;
}

View file

@ -49,7 +49,7 @@ natbyname(char *name, natid *result)
return 0;
}
}
*result = 255;
*result = NATID_BAD;
return -1;
}