mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-30 13:00:54 +00:00
Merge branch 'multi-admin' into battle
# Conflicts: # src/k_kart.c
This commit is contained in:
commit
8de9c46b68
23 changed files with 179 additions and 109 deletions
|
@ -1228,7 +1228,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
|||
char *svalue;
|
||||
UINT8 stealth = false;
|
||||
|
||||
if (playernum != serverplayer && playernum != adminplayer && !serverloading)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum) && !serverloading)
|
||||
{
|
||||
// not from server or remote admin, must be hacked/buggy client
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]);
|
||||
|
@ -1357,7 +1357,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||
// send the value of the variable
|
||||
XBOXSTATIC UINT8 buf[128];
|
||||
UINT8 *p = buf;
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or admin can change: %s %s\n"), var->name, var->string);
|
||||
return;
|
||||
|
|
|
@ -1365,15 +1365,19 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||
netbuffer->u.servercfg.gamestate = (UINT8)gamestate;
|
||||
netbuffer->u.servercfg.gametype = (UINT8)gametype;
|
||||
netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame;
|
||||
netbuffer->u.servercfg.adminplayer = (SINT8)adminplayer;
|
||||
|
||||
// we fill these structs with FFs so that any players not in game get sent as 0xFFFF
|
||||
// which is nice and easy for us to detect
|
||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
||||
|
||||
memset(netbuffer->u.servercfg.adminplayers, -1, sizeof(netbuffer->u.servercfg.adminplayers));
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (i < 4)
|
||||
netbuffer->u.servercfg.adminplayers[i] = (SINT8)adminplayers[i];
|
||||
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
netbuffer->u.servercfg.playerskins[i] = (UINT8)players[i].skin;
|
||||
|
@ -2029,7 +2033,7 @@ static void CL_ConnectToServer(boolean viams)
|
|||
G_SetGamestate(GS_WAITINGPLAYERS);
|
||||
wipegamestate = GS_WAITINGPLAYERS;
|
||||
|
||||
adminplayer = -1;
|
||||
ClearAdminPlayers();
|
||||
pnumnodes = 1;
|
||||
oldtic = I_GetTime() - 1;
|
||||
#ifndef NONET
|
||||
|
@ -2408,8 +2412,10 @@ static void CL_RemovePlayer(INT32 playernum)
|
|||
// Reset the name
|
||||
sprintf(player_names[playernum], "Player %d", playernum+1);
|
||||
|
||||
if (playernum == adminplayer)
|
||||
adminplayer = -1; // don't stay admin after you're gone
|
||||
if (IsPlayerAdmin(playernum))
|
||||
{
|
||||
RemoveAdminPlayer(playernum); // don't stay admin after you're gone
|
||||
}
|
||||
|
||||
if (playernum == displayplayer)
|
||||
displayplayer = consoleplayer; // don't look through someone's view who isn't there
|
||||
|
@ -2529,7 +2535,7 @@ static void Command_Nodes(void)
|
|||
if (I_GetNodeAddress && (address = I_GetNodeAddress(playernode[i])) != NULL)
|
||||
CONS_Printf(" - %s", address);
|
||||
|
||||
if (i == adminplayer)
|
||||
if (IsPlayerAdmin(i))
|
||||
CONS_Printf(M_GetText(" (verified admin)"));
|
||||
|
||||
if (players[i].spectator)
|
||||
|
@ -2554,7 +2560,7 @@ static void Command_Ban(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
if (server || IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
|
@ -2620,7 +2626,7 @@ static void Command_Kick(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
if (server || IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
|
@ -2677,7 +2683,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
pnum = READUINT8(*p);
|
||||
msg = READUINT8(*p);
|
||||
|
||||
if (pnum == serverplayer && playernum == adminplayer)
|
||||
if (pnum == serverplayer && IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Printf(M_GetText("Server is being shut down remotely. Goodbye!\n"));
|
||||
|
||||
|
@ -2688,7 +2694,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
}
|
||||
|
||||
// Is playernum authorized to make this kick?
|
||||
if (playernum != serverplayer && playernum != adminplayer
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum)
|
||||
&& !(playerpernode[playernode[playernum]] == 2
|
||||
&& nodetoplayer2[playernode[playernum]] == pnum))
|
||||
{
|
||||
|
@ -3025,7 +3031,7 @@ void D_QuitNetGame(void)
|
|||
}
|
||||
|
||||
D_CloseConnection();
|
||||
adminplayer = -1;
|
||||
ClearAdminPlayers();
|
||||
|
||||
DEBFILE("===========================================================================\n"
|
||||
" Log finish\n"
|
||||
|
@ -3056,7 +3062,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
INT16 node, newplayernum;
|
||||
boolean splitscreenplayer;
|
||||
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
// protect against hacked/buggy client
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
|
||||
|
@ -3541,7 +3547,9 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);
|
||||
gametype = netbuffer->u.servercfg.gametype;
|
||||
modifiedgame = netbuffer->u.servercfg.modifiedgame;
|
||||
adminplayer = netbuffer->u.servercfg.adminplayer;
|
||||
for (j = 0; j < 4; j++)
|
||||
adminplayers[j] = netbuffer->u.servercfg.adminplayers[j];
|
||||
j = 0;
|
||||
memcpy(server_context, netbuffer->u.servercfg.server_context, 8);
|
||||
}
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ typedef struct
|
|||
|
||||
UINT8 gametype;
|
||||
UINT8 modifiedgame;
|
||||
SINT8 adminplayer; // Needs to be signed
|
||||
SINT8 adminplayers[4]; // Needs to be signed
|
||||
|
||||
char server_context[8]; // Unique context id, generated at server startup.
|
||||
|
||||
|
@ -329,7 +329,7 @@ typedef struct
|
|||
UINT8 cheatsenabled;
|
||||
UINT8 isdedicated;
|
||||
UINT8 fileneedednum;
|
||||
SINT8 adminplayer;
|
||||
SINT8 adminplayers[4];
|
||||
tic_t time;
|
||||
tic_t leveltime;
|
||||
char servername[MAXSERVERNAME];
|
||||
|
|
14
src/d_main.c
14
src/d_main.c
|
@ -871,19 +871,23 @@ static void IdentifyVersion(void)
|
|||
#else
|
||||
const char *musicfile = "music.dta";
|
||||
#endif
|
||||
const char *kmusicfile;
|
||||
const char *musicpath = va(pandf,srb2waddir,musicfile);
|
||||
const char *kmusicpath;
|
||||
int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music!
|
||||
int kms;
|
||||
if (ms == 1)
|
||||
D_AddFile(musicpath);
|
||||
else if (ms == 0)
|
||||
I_Error("File %s has been modified with non-music lumps",musicfile);
|
||||
|
||||
const char* kmusicfile = "music.kart";
|
||||
const char* kmusicpath = va(pandf,srb2waddir,kmusicfile);
|
||||
ms = W_VerifyNMUSlumps(kmusicpath);
|
||||
if (ms == 1)
|
||||
kmusicfile = "music.kart";
|
||||
kmusicpath = va(pandf,srb2waddir,kmusicfile);
|
||||
kms = W_VerifyNMUSlumps(kmusicpath); // kill me now
|
||||
|
||||
if (kms == 1)
|
||||
D_AddFile(kmusicpath);
|
||||
else if (ms == 0)
|
||||
else if (kms == 0)
|
||||
I_Error("File %s has been modified with non-music lumps",kmusicfile);
|
||||
}
|
||||
#endif
|
||||
|
|
114
src/d_netcmd.c
114
src/d_netcmd.c
|
@ -409,7 +409,7 @@ consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL
|
|||
INT16 gametype = GT_RACE; // SRB2kart
|
||||
boolean splitscreen = false;
|
||||
boolean circuitmap = true; // SRB2kart
|
||||
INT32 adminplayer = -1;
|
||||
INT32 adminplayers[] = { -1, -1, -1, -1 }; // Hardcoded to four admins for now.
|
||||
|
||||
/// \warning Keep this up-to-date if you add/remove/rename net text commands
|
||||
const char *netxcmdnames[MAXNETXCMD - 1] =
|
||||
|
@ -1057,7 +1057,7 @@ UINT8 CanChangeSkin(INT32 playernum)
|
|||
return true;
|
||||
|
||||
// Force skin in effect.
|
||||
if (client && (cv_forceskin.value != -1) && !(adminplayer == playernum && serverplayer == -1))
|
||||
if (client && (cv_forceskin.value != -1) && !(IsPlayerAdmin(playernum) && serverplayer == -1))
|
||||
return false;
|
||||
|
||||
// Can change skin in intermission and whatnot.
|
||||
|
@ -1208,7 +1208,7 @@ static void SendNameAndColor(void)
|
|||
snacpending++;
|
||||
|
||||
// Don't change name if muted
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
|
||||
else // Cleanup name if changing it
|
||||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
|
@ -1615,7 +1615,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
|
|||
mapchangepending = 0;
|
||||
// spawn the server if needed
|
||||
// reset players if there is a new one
|
||||
if (!(adminplayer == consoleplayer))
|
||||
if (!IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
if (SV_SpawnServer())
|
||||
buf[0] &= ~(1<<1);
|
||||
|
@ -1673,7 +1673,7 @@ static void Command_Map_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (client && !(adminplayer == consoleplayer))
|
||||
if (client && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
@ -1802,7 +1802,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
|||
INT32 resetplayer = 1, lastgametype;
|
||||
UINT8 skipprecutscene, FLS;
|
||||
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -1899,7 +1899,7 @@ static void Command_Pause(void)
|
|||
else
|
||||
WRITEUINT8(cp, 0);
|
||||
|
||||
if (cv_pause.value || server || (adminplayer == consoleplayer))
|
||||
if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
if (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION))
|
||||
{
|
||||
|
@ -1917,7 +1917,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
|||
UINT8 dedicatedpause = false;
|
||||
const char *playername;
|
||||
|
||||
if (netgame && !cv_pause.value && playernum != serverplayer && playernum != adminplayer)
|
||||
if (netgame && !cv_pause.value && playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -2046,7 +2046,7 @@ static void Got_RandomSeed(UINT8 **cp, INT32 playernum)
|
|||
*/
|
||||
static void Command_Clearscores_f(void)
|
||||
{
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
return;
|
||||
|
||||
SendNetXCmd(XD_CLEARSCORES, NULL, 1);
|
||||
|
@ -2066,7 +2066,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
|
|||
INT32 i;
|
||||
|
||||
(void)cp;
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -2287,7 +2287,7 @@ static void Command_ServerTeamChange_f(void)
|
|||
UINT16 usvalue;
|
||||
NetPacket.value.l = NetPacket.value.b = 0;
|
||||
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
@ -2434,7 +2434,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
|
||||
if (NetPacket.packet.verification) // Special marker that the server sent the request
|
||||
{
|
||||
if (playernum != serverplayer && (playernum != adminplayer))
|
||||
if (playernum != serverplayer && (!IsPlayerAdmin(playernum)))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -2473,7 +2473,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (playernum != serverplayer && (playernum != adminplayer))
|
||||
if (playernum != serverplayer && (!IsPlayerAdmin(playernum)))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -2791,6 +2791,53 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
|
|||
#endif
|
||||
}
|
||||
|
||||
boolean IsPlayerAdmin(INT32 playernum)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
if (playernum == adminplayers[i])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetAdminPlayer(INT32 playernum)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (playernum == adminplayers[i])
|
||||
return; // Player is already admin
|
||||
|
||||
if (adminplayers[i] == -1)
|
||||
{
|
||||
adminplayers[i] = playernum; // Set the player to a free spot
|
||||
break; // End the loop now. If it keeps going, the same player might get assigned to two slots.
|
||||
}
|
||||
|
||||
if (i == 3 && adminplayers[i] != -1) // End of the loop and all slots are full
|
||||
{
|
||||
adminplayers[0] = playernum; // Overwrite the first slot
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClearAdminPlayers(void)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
adminplayers[i] = -1;
|
||||
}
|
||||
|
||||
void RemoveAdminPlayer(INT32 playernum)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
if (playernum == adminplayers[i])
|
||||
adminplayers[i] = -1;
|
||||
}
|
||||
|
||||
static void Command_Verify_f(void)
|
||||
{
|
||||
XBOXSTATIC char buf[8]; // Should be plenty
|
||||
|
@ -2839,7 +2886,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
|
|||
return;
|
||||
}
|
||||
|
||||
adminplayer = num;
|
||||
SetAdminPlayer(num);
|
||||
|
||||
if (num != consoleplayer)
|
||||
return;
|
||||
|
@ -2858,7 +2905,7 @@ static void Command_MotD_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
@ -2905,7 +2952,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
|
|||
if (!isprint(mymotd[i]) || mymotd[i] == ';')
|
||||
kick = true;
|
||||
|
||||
if ((playernum != serverplayer && playernum != adminplayer) || kick)
|
||||
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -2942,7 +2989,7 @@ static void Command_RunSOC(void)
|
|||
else
|
||||
fn = COM_Argv(1);
|
||||
|
||||
if (netgame && !(server || consoleplayer == adminplayer))
|
||||
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
@ -2968,7 +3015,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
|||
char filename[256];
|
||||
filestatus_t ncs = FS_NOTFOUND;
|
||||
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -3039,7 +3086,7 @@ static void Command_Addfile(void)
|
|||
if (!musiconly)
|
||||
{
|
||||
// ... But only so long as they contain nothing more then music and sprites.
|
||||
if (netgame && !(server || adminplayer == consoleplayer))
|
||||
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
@ -3082,7 +3129,7 @@ static void Command_Addfile(void)
|
|||
WRITEMEM(buf_p, md5sum, 16);
|
||||
}
|
||||
|
||||
if (adminplayer == consoleplayer) // Request to add file
|
||||
if (IsPlayerAdmin(consoleplayer)) // Request to add file
|
||||
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
|
||||
else
|
||||
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
||||
|
@ -3131,7 +3178,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
UINT8 md5sum[16];
|
||||
boolean kick = false;
|
||||
boolean toomany = false;
|
||||
INT32 i;
|
||||
INT32 i,j;
|
||||
size_t packetsize = 0;
|
||||
serverinfo_pak *dummycheck = NULL;
|
||||
|
||||
|
@ -3150,7 +3197,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
if (!isprint(filename[i]) || filename[i] == ';')
|
||||
kick = true;
|
||||
|
||||
if ((playernum != serverplayer && playernum != adminplayer) || kick)
|
||||
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
|
||||
|
@ -3189,8 +3236,9 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
|
||||
CONS_Printf("%s",message);
|
||||
|
||||
if (adminplayer)
|
||||
COM_BufAddText(va("sayto %d %s", adminplayer, message));
|
||||
for (j = 0; j < 4; j++)
|
||||
if (adminplayers[j])
|
||||
COM_BufAddText(va("sayto %d %s", adminplayers[j], message));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -3584,7 +3632,7 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
if (playeringame[i])
|
||||
players[i].ctfteam = 0;
|
||||
|
||||
if (server || (adminplayer == consoleplayer))
|
||||
if (server || (IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CV_StealthSetValue(&cv_teamscramble, 0);
|
||||
teamscramble = 0;
|
||||
|
@ -3667,7 +3715,7 @@ static void TeamScramble_OnChange(void)
|
|||
if (!cv_teamscramble.value)
|
||||
teamscramble = 0;
|
||||
|
||||
if (!G_GametypeHasTeams() && (server || consoleplayer == adminplayer))
|
||||
if (!G_GametypeHasTeams() && (server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
CV_StealthSetValue(&cv_teamscramble, 0);
|
||||
|
@ -3846,7 +3894,7 @@ static void Command_ExitLevel_f(void)
|
|||
{
|
||||
if (!(netgame || (multiplayer && gametype != GT_COOP)) && !cv_debug)
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
else if (!(server || (adminplayer == consoleplayer)))
|
||||
else if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
else if (gamestate != GS_LEVEL || demoplayback)
|
||||
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
|
||||
|
@ -3862,7 +3910,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
|
|||
if (gameaction == ga_completed)
|
||||
return;
|
||||
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
|
@ -4035,7 +4083,7 @@ static void Command_Cheats_f(void)
|
|||
{
|
||||
if (COM_CheckParm("off"))
|
||||
{
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
else
|
||||
CV_ResetCheatNetVars();
|
||||
|
@ -4045,7 +4093,7 @@ static void Command_Cheats_f(void)
|
|||
if (CV_CheatsEnabled())
|
||||
{
|
||||
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
|
||||
if (server || (adminplayer == consoleplayer))
|
||||
if (server || (IsPlayerAdmin(consoleplayer)))
|
||||
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
|
||||
}
|
||||
else
|
||||
|
@ -4114,7 +4162,7 @@ static void Command_Archivetest_f(void)
|
|||
*/
|
||||
static void ForceSkin_OnChange(void)
|
||||
{
|
||||
if ((server || adminplayer == consoleplayer) && (cv_forceskin.value < -1 || cv_forceskin.value >= numskins))
|
||||
if ((server || IsPlayerAdmin(consoleplayer)) && (cv_forceskin.value < -1 || cv_forceskin.value >= numskins))
|
||||
{
|
||||
if (cv_forceskin.value == -2)
|
||||
CV_SetValue(&cv_forceskin, numskins-1);
|
||||
|
@ -4144,7 +4192,7 @@ static void ForceSkin_OnChange(void)
|
|||
//Allows the player's name to be changed if cv_mute is off.
|
||||
static void Name_OnChange(void)
|
||||
{
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
|
||||
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
|
||||
|
@ -4267,7 +4315,7 @@ static void Color2_OnChange(void)
|
|||
*/
|
||||
static void Mute_OnChange(void)
|
||||
{
|
||||
if (server || (adminplayer == consoleplayer))
|
||||
if (server || (IsPlayerAdmin(consoleplayer)))
|
||||
return;
|
||||
|
||||
if (cv_mute.value)
|
||||
|
|
|
@ -234,6 +234,10 @@ void Command_Retry_f(void);
|
|||
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
|
||||
void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect);
|
||||
void ObjectPlace_OnChange(void);
|
||||
boolean IsPlayerAdmin(INT32 playernum);
|
||||
void SetAdminPlayer(INT32 playernum);
|
||||
void ClearAdminPlayers(void);
|
||||
void RemoveAdminPlayer(INT32 playernum);
|
||||
void ItemFinder_OnChange(void);
|
||||
void D_SetPassword(const char *pw);
|
||||
|
||||
|
|
|
@ -8788,9 +8788,9 @@ static inline int lib_getenum(lua_State *L)
|
|||
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"admin")) {
|
||||
if (!playeringame[adminplayer] || adminplayer == serverplayer)
|
||||
return 0;
|
||||
LUA_PushUserdata(L, &players[adminplayer], META_PLAYER);
|
||||
//if (!playeringame[adminplayer] || IsPlayerAdmin(serverplayer))
|
||||
//return 0;
|
||||
//LUA_PushUserdata(L, &players[adminplayer], META_PLAYER);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"emeralds")) {
|
||||
lua_pushinteger(L, emeralds);
|
||||
|
|
|
@ -493,7 +493,8 @@ extern consvar_t cv_timetic; // display high resolution timer
|
|||
extern consvar_t cv_forceskin; // force clients to use the server's skin
|
||||
extern consvar_t cv_downloading; // allow clients to downloading WADs.
|
||||
extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
|
||||
extern INT32 adminplayer, serverplayer;
|
||||
extern INT32 serverplayer;
|
||||
extern INT32 adminplayers[4];
|
||||
|
||||
/// \note put these in d_clisrv outright?
|
||||
|
||||
|
|
|
@ -1345,7 +1345,7 @@ void F_CutsceneTicker(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (netgame && i != serverplayer && i != adminplayer)
|
||||
if (netgame && i != serverplayer && !IsPlayerAdmin(i))
|
||||
continue;
|
||||
|
||||
if (players[i].cmd.buttons & BT_BRAKE || players[i].cmd.buttons & BT_ACCELERATE) // SRB2kart
|
||||
|
|
|
@ -2330,7 +2330,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->panim = PA_IDLE; // standing animation
|
||||
|
||||
if ((netgame || multiplayer) && !p->spectator)
|
||||
p->powers[pw_flashing] = K_GetKartFlashing(p)-1; // Babysitting deterrent
|
||||
p->powers[pw_flashing] = K_GetKartFlashing()-1; // Babysitting deterrent
|
||||
|
||||
if (p-players == consoleplayer)
|
||||
{
|
||||
|
|
|
@ -361,14 +361,14 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
|
|||
numwords = COM_Argc() - usedargs;
|
||||
I_Assert(numwords > 0);
|
||||
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("The chat is muted. You can't say anything at the moment.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Only servers/admins can CSAY.
|
||||
if(!server && adminplayer != consoleplayer)
|
||||
if(!server && IsPlayerAdmin(consoleplayer))
|
||||
flags &= ~HU_CSAY;
|
||||
|
||||
// We handle HU_SERVER_SAY, not the caller.
|
||||
|
@ -462,7 +462,7 @@ static void Command_CSay_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if(!server && adminplayer != consoleplayer)
|
||||
if(!server && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Only servers and admins can use csay.\n"));
|
||||
return;
|
||||
|
@ -491,7 +491,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
msg = (char *)*p;
|
||||
SKIPSTRING(*p);
|
||||
|
||||
if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && playernum != adminplayer)
|
||||
if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, cv_mute.value ?
|
||||
M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"),
|
||||
|
@ -589,7 +589,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
// Give admins and remote admins their symbols.
|
||||
if (playernum == serverplayer)
|
||||
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
|
||||
else if (playernum == adminplayer)
|
||||
else if (IsPlayerAdmin(playernum))
|
||||
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(remotechar) + 1, PU_STATIC, NULL);
|
||||
if (tempchar)
|
||||
{
|
||||
|
@ -724,7 +724,7 @@ static void HU_queueChatChar(char c)
|
|||
} while (c);
|
||||
|
||||
// last minute mute check
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("The chat is muted. You can't say anything at the moment.\n"));
|
||||
return;
|
||||
|
@ -782,9 +782,9 @@ boolean HU_Responder(event_t *ev)
|
|||
{
|
||||
// enter chat mode
|
||||
if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1])
|
||||
&& netgame && (!cv_mute.value || server || (adminplayer == consoleplayer)))
|
||||
&& netgame && (!cv_mute.value || server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
return false;
|
||||
chat_on = true;
|
||||
w_chat[0] = 0;
|
||||
|
@ -792,9 +792,9 @@ boolean HU_Responder(event_t *ev)
|
|||
return true;
|
||||
}
|
||||
if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1])
|
||||
&& netgame && (!cv_mute.value || server || (adminplayer == consoleplayer)))
|
||||
&& netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer))))
|
||||
{
|
||||
if (cv_mute.value && !(server || adminplayer == consoleplayer))
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
return false;
|
||||
chat_on = true;
|
||||
w_chat[0] = 0;
|
||||
|
|
25
src/k_kart.c
25
src/k_kart.c
|
@ -1452,7 +1452,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->kartstuff[k_comebackshowninfo] = 1;
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_spinout] == 0 && player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing(player))
|
||||
if (player->kartstuff[k_spinout] == 0 && player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing())
|
||||
player->powers[pw_flashing]--;
|
||||
|
||||
/*if (player->kartstuff[k_wipeouttimer])
|
||||
|
@ -1751,7 +1751,7 @@ fixed_t K_GetKartAccel(player_t *player)
|
|||
return FixedMul(k_accel, K_GetKartBoostPower(player, false));
|
||||
}
|
||||
|
||||
UINT16 K_GetKartFlashing(player_t *player)
|
||||
UINT16 K_GetKartFlashing(void)
|
||||
{
|
||||
UINT16 tics = flashingtics;
|
||||
if (gametype != GT_RACE)
|
||||
|
@ -1848,7 +1848,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source)
|
|||
else
|
||||
player->kartstuff[k_spinouttimer] = 1*TICRATE; // ? Whipeout
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
|
||||
player->kartstuff[k_spinout] = player->kartstuff[k_spinouttimer];
|
||||
|
||||
|
@ -1928,7 +1928,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
|
|||
|
||||
player->kartstuff[k_squishedtimer] = 1*TICRATE;
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
|
||||
player->mo->flags |= MF_NOCLIP;
|
||||
|
||||
|
@ -1986,7 +1986,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
|
|||
player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2);
|
||||
player->kartstuff[k_spinout] = player->kartstuff[k_spinouttimer];
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||
|
@ -2063,11 +2063,10 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force)
|
|||
|
||||
player->kartstuff[k_balloon]++;
|
||||
player->kartstuff[k_comebackpoints] = 0;
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
victim->powers[pw_flashing] = K_GetKartFlashing(victim);
|
||||
victim->powers[pw_flashing] = K_GetKartFlashing();
|
||||
victim->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
return;
|
||||
|
@ -2163,6 +2162,7 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
mobj_t *th;
|
||||
angle_t an;
|
||||
fixed_t x, y, z;
|
||||
mobj_t *throwmo;
|
||||
//INT32 dir;
|
||||
|
||||
// angle at which you fire, is player angle
|
||||
|
@ -2221,7 +2221,7 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
|
||||
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
|
||||
x = y + P_ReturnThrustY(source, an, source->radius + th->radius);
|
||||
mobj_t *throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
|
||||
throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
|
||||
throwmo->movecount = 1;
|
||||
throwmo->movedir = source->angle - an;
|
||||
P_SetTarget(&throwmo->target, source);
|
||||
|
@ -2301,6 +2301,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
|
|||
angle_t newangle;
|
||||
fixed_t newx;
|
||||
fixed_t newy;
|
||||
mobj_t *throwmo;
|
||||
|
||||
if (!player)
|
||||
return NULL;
|
||||
|
@ -2403,7 +2404,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
|
|||
mo->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
|
||||
mobj_t *throwmo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FIREDITEM);
|
||||
throwmo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FIREDITEM);
|
||||
P_SetTarget(&throwmo->target, player->mo);
|
||||
throwmo->movecount = 0; // above player
|
||||
}
|
||||
|
@ -4929,10 +4930,10 @@ static void K_drawStartLakitu(void)
|
|||
patch_t *localpatch = kp_nodraw;
|
||||
|
||||
fixed_t adjustY;
|
||||
fixed_t numFrames = 32; // Number of frames for the animation
|
||||
tic_t numFrames = 32; // Number of frames for the animation
|
||||
fixed_t finalOffset = 206; // Number of pixels to offset the patch (This is actually 200, the 6 is a buffer for the parabola)
|
||||
|
||||
if (leveltime >= 0 && leveltime < 52) localpatch = kp_lakitustart[0];
|
||||
if (leveltime < 52) localpatch = kp_lakitustart[0];
|
||||
if (leveltime >= 52 && leveltime < 56) localpatch = kp_lakitustart[1];
|
||||
if (leveltime >= 56 && leveltime < 60) localpatch = kp_lakitustart[2];
|
||||
if (leveltime >= 60 && leveltime < 64) localpatch = kp_lakitustart[3];
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
UINT8 colortranslations[MAXSKINCOLORS][16];
|
||||
extern const char *KartColor_Names[MAXSKINCOLORS];
|
||||
void K_StarmanColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
|
||||
|
@ -18,6 +19,7 @@ void K_RegisterKartStuff(void);
|
|||
|
||||
UINT8 K_GetKartCC(void);
|
||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce);
|
||||
void K_LakituChecker(player_t *player);
|
||||
void K_KartMoveAnimation(player_t *player);
|
||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||
void K_SpinPlayer(player_t *player, mobj_t *source);
|
||||
|
@ -34,12 +36,13 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
|
|||
void K_MomentumToFacing(player_t *player);
|
||||
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
|
||||
fixed_t K_GetKartAccel(player_t *player);
|
||||
UINT16 K_GetKartFlashing(player_t *player);
|
||||
UINT16 K_GetKartFlashing(void);
|
||||
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CheckBalloons(void);
|
||||
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);
|
||||
void K_drawKartHUD(void);
|
||||
|
||||
// =========================================================================
|
||||
|
|
|
@ -2152,11 +2152,11 @@ static int lib_kGetKartAccel(lua_State *L)
|
|||
|
||||
static int lib_kGetKartFlashing(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
//player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
//HUDSAFE
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
lua_pushinteger(L, K_GetKartFlashing(player));
|
||||
//if (!player)
|
||||
//return LUA_ErrInvalid(L, "player_t");
|
||||
lua_pushinteger(L, K_GetKartFlashing());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
|
|||
lua_pop(gL, 1); // pop flags
|
||||
|
||||
// requires server/admin and the player is not one of them
|
||||
if ((flags & 1) && playernum != serverplayer && playernum != adminplayer)
|
||||
if ((flags & 1) && playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||
goto deny;
|
||||
|
||||
lua_rawgeti(gL, -1, 1); // push function from command info table
|
||||
|
@ -131,7 +131,7 @@ void COM_Lua_f(void)
|
|||
UINT8 argc;
|
||||
lua_pop(gL, 1); // pop command info table
|
||||
|
||||
if (flags & 1 && !server && adminplayer != playernum) // flag 1: only server/admin can use this command.
|
||||
if (flags & 1 && !server && !IsPlayerAdmin(playernum)) // flag 1: only server/admin can use this command.
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
|
|
|
@ -1350,7 +1350,7 @@ void Command_ObjectPlace_f(void)
|
|||
players[0].mo->color = op_oldcolor;
|
||||
|
||||
// This is necessary for recovery of dying players.
|
||||
if (players[0].powers[pw_flashing] >= K_GetKartFlashing(&players[0]))
|
||||
players[0].powers[pw_flashing] = K_GetKartFlashing(&players[0]) - 1;
|
||||
if (players[0].powers[pw_flashing] >= K_GetKartFlashing())
|
||||
players[0].powers[pw_flashing] = K_GetKartFlashing() - 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2620,7 +2620,7 @@ void M_StartControlPanel(void)
|
|||
MPauseMenu[mpause_switchteam].status = IT_DISABLED;
|
||||
MPauseMenu[mpause_psetup].status = IT_DISABLED;
|
||||
|
||||
if ((server || adminplayer == consoleplayer))
|
||||
if ((server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
MPauseMenu[mpause_switchmap].status = IT_STRING | IT_CALL;
|
||||
if (G_GametypeHasTeams())
|
||||
|
@ -3962,7 +3962,7 @@ static void M_Options(INT32 choice)
|
|||
(void)choice;
|
||||
|
||||
// if the player is not admin or server, disable server options
|
||||
OP_MainMenu[5].status = (Playing() && !(server || adminplayer == consoleplayer)) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
|
||||
OP_MainMenu[5].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
|
||||
|
||||
// if the player is playing _at all_, disable the erase data options
|
||||
OP_DataOptionsMenu[1].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
|
||||
|
|
|
@ -2592,7 +2592,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
|
|||
target->momy = FixedMul(FINESINE(fa),target->target->radius);
|
||||
}
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
P_SetMobjState(target->tracer, S_NIGHTSHURT1);
|
||||
S_StartSound(target, sfx_nghurt);
|
||||
|
||||
|
@ -2970,6 +2970,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
#else
|
||||
static const boolean force = false;
|
||||
#endif
|
||||
mobj_t *blueexplode;
|
||||
|
||||
if (objectplacing)
|
||||
return false;
|
||||
|
@ -3161,7 +3162,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
{
|
||||
// Just need to do this now! Being thrown upwards is done by the explosion.
|
||||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING);
|
||||
mobj_t *blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
|
||||
blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
|
||||
P_SetTarget(&blueexplode->target, source);
|
||||
return true;
|
||||
}
|
||||
|
@ -3310,7 +3311,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
player->health -= damage; // mirror mobj health here
|
||||
if (damage < 10000)
|
||||
{
|
||||
target->player->powers[pw_flashing] = K_GetKartFlashing(target->player);
|
||||
target->player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
|
||||
P_PlayerRingBurst(player, damage);
|
||||
}
|
||||
|
|
|
@ -216,10 +216,10 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
}
|
||||
}
|
||||
// You were in pain state after taking a hit, and you're moving out of pain state now?
|
||||
else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate)
|
||||
else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing() && state != mobj->info->painstate)
|
||||
{
|
||||
// Start flashing, since you've landed.
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player)-1;
|
||||
player->powers[pw_flashing] = K_GetKartFlashing()-1;
|
||||
//P_DoPityCheck(player);
|
||||
}
|
||||
|
||||
|
|
|
@ -2456,11 +2456,11 @@ static void P_LoadRecordGhosts(void)
|
|||
if (cv_ghost_staff.value)
|
||||
{
|
||||
lumpnum_t l;
|
||||
UINT8 i = 1;
|
||||
while (i <= 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(gamemap),i))) != LUMPERROR)
|
||||
UINT8 j = 1;
|
||||
while (j <= 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(gamemap),j))) != LUMPERROR)
|
||||
{
|
||||
G_AddGhost(va("%sS%02u",G_BuildMapName(gamemap),i));
|
||||
i++;
|
||||
G_AddGhost(va("%sS%02u",G_BuildMapName(gamemap),j));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7553,7 +7553,7 @@ void T_Pusher(pusher_t *p)
|
|||
if (thing->player && thing->player->pflags & PF_ROPEHANG)
|
||||
continue;
|
||||
|
||||
if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (K_GetKartFlashing(thing->player)/4)*3 && thing->player->powers[pw_flashing] <= K_GetKartFlashing(thing->player)))
|
||||
if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (K_GetKartFlashing()/4)*3 && thing->player->powers[pw_flashing] <= K_GetKartFlashing()))
|
||||
continue;
|
||||
|
||||
inFOF = touching = moved = false;
|
||||
|
|
|
@ -863,7 +863,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
|||
|
||||
P_ResetPlayer(player);
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||
|
||||
if (player->timeshit != UINT8_MAX)
|
||||
++player->timeshit;
|
||||
|
@ -5877,7 +5877,7 @@ static void P_NiGHTSMovement(player_t *player)
|
|||
}
|
||||
|
||||
// Currently reeling from being hit.
|
||||
if (player->powers[pw_flashing] > (2*K_GetKartFlashing(player))/3)
|
||||
if (player->powers[pw_flashing] > (2*K_GetKartFlashing())/3)
|
||||
{
|
||||
{
|
||||
const angle_t fa = (FixedAngle(player->flyangle*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK;
|
||||
|
@ -9410,7 +9410,7 @@ void P_PlayerThink(player_t *player)
|
|||
if (player->powers[pw_invulnerability] && player->powers[pw_invulnerability] < UINT16_MAX)
|
||||
player->powers[pw_invulnerability]--;
|
||||
|
||||
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX && ((player->pflags & PF_NIGHTSMODE) || player->powers[pw_flashing] < K_GetKartFlashing(player)))
|
||||
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX && ((player->pflags & PF_NIGHTSMODE) || player->powers[pw_flashing] < K_GetKartFlashing()))
|
||||
player->powers[pw_flashing]--;
|
||||
|
||||
if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter
|
||||
|
@ -9502,7 +9502,7 @@ void P_PlayerThink(player_t *player)
|
|||
&& player->kartstuff[k_bootimer] == 0 && player->kartstuff[k_growshrinktimer] <= 0
|
||||
&& (player->kartstuff[k_comebacktimer] == 0 || (gametype == GT_RACE || player->kartstuff[k_balloon] > 0)))
|
||||
{
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing(player) && (leveltime & 1))
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing() && (leveltime & 1))
|
||||
player->mo->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||
|
|
|
@ -2582,7 +2582,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
|
|||
|
||||
if (P_IsLocalPlayer(player))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname);
|
||||
else if(server || adminplayer == consoleplayer)
|
||||
else if(server || IsPlayerAdmin(consoleplayer))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
|
||||
|
||||
SetPlayerSkinByNum(playernum, 0);
|
||||
|
@ -2651,7 +2651,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
|||
|
||||
if (P_IsLocalPlayer(player))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Skin %d not found\n"), skinnum);
|
||||
else if(server || adminplayer == consoleplayer)
|
||||
else if(server || IsPlayerAdmin(consoleplayer))
|
||||
CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
|
||||
SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue