No more magic numbers

This commit is contained in:
Prisima the Fox 2016-10-21 16:16:54 -04:00
parent defc7c1645
commit 6733152651
1 changed files with 9 additions and 9 deletions

View File

@ -2517,7 +2517,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
INT32 pnum, msg;
XBOXSTATIC char buf[3 + MAX_REASONLENGTH];
char *reason = buf;
INT32 kickreason = 1;
kickreason_t kickreason = KR_KICK;
pnum = READUINT8(*p);
msg = READUINT8(*p);
@ -2598,17 +2598,17 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
{
case KICK_MSG_GO_AWAY:
CONS_Printf(M_GetText("has been kicked (Go away)\n"));
kickreason = 1;
kickreason = KR_KICK;
break;
#ifdef NEWPING
case KICK_MSG_PING_HIGH:
CONS_Printf(M_GetText("left the game (Broke ping limit)\n"));
kickreason = 2;
kickreason = KR_PINGLIMIT;
break;
#endif
case KICK_MSG_CON_FAIL:
CONS_Printf(M_GetText("left the game (Synch failure)\n"));
kickreason = 3;
kickreason = KR_SYNCH;
if (M_CheckParm("-consisdump")) // Helps debugging some problems
{
@ -2645,26 +2645,26 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
break;
case KICK_MSG_TIMEOUT:
CONS_Printf(M_GetText("left the game (Connection timeout)\n"));
kickreason = 4;
kickreason = KR_TIMEOUT;
break;
case KICK_MSG_PLAYER_QUIT:
if (netgame) // not splitscreen/bots
CONS_Printf(M_GetText("left the game\n"));
kickreason = 6;
kickreason = KR_LEAVE;
break;
case KICK_MSG_BANNED:
CONS_Printf(M_GetText("has been banned (Don't come back)\n"));
kickreason = 5;
kickreason = KR_BAN;
break;
case KICK_MSG_CUSTOM_KICK:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been kicked (%s)\n"), reason);
kickreason = 1;
kickreason = KR_KICK;
break;
case KICK_MSG_CUSTOM_BAN:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been banned (%s)\n"), reason);
kickreason = 5;
kickreason = KR_BAN;
break;
}