diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 309bdc36e..b76586249 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -84,6 +84,8 @@ static void TeamScramble_OnChange(void); static void NetTimeout_OnChange(void); static void JoinTimeout_OnChange(void); +static void PlayStyle_OnChange(void); + static void Ringslinger_OnChange(void); static void Gravity_OnChange(void); static void ForceSkin_OnChange(void); @@ -350,7 +352,7 @@ static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NUL consvar_t cv_inttime = {"inttime", "10", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t playstyle_cons_t[] = {{0, "Individual"}, {1, "Sharing"}, {2, "Together"}, {0, NULL}}; -consvar_t cv_playstyle = {"playstyle", "Together", CV_NETVAR|CV_CHEAT, playstyle_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_playstyle = {"playstyle", "Together", CV_NETVAR|CV_CHEAT|CV_CALL, playstyle_cons_t, PlayStyle_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_steallives = {"steallives", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -3402,6 +3404,29 @@ static void JoinTimeout_OnChange(void) jointimeout = (tic_t)cv_jointimeout.value; } +static void PlayStyle_OnChange(void) +{ + if (!(netgame || multiplayer) || gametype != GT_COOP || G_IsSpecialStage(gamemap)) + return; + if (cv_playstyle.value != 2) + { + INT32 i; + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i]) + continue; + + if (!players[i].spectator) + continue; + + if (players[i].lives <= 0) + continue; + + players[i].playerstate = PST_REBORN; + } + } +} + UINT32 timelimitintics = 0; /** Deals with a timelimit change by printing the change to the console. diff --git a/src/p_user.c b/src/p_user.c index 53988e37b..a3bb7e4b6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8123,8 +8123,8 @@ boolean P_GetLives(player_t *player) { if (players[maxlivesplayer].mo) S_StartSound(players[maxlivesplayer].mo, sfx_jshard); // placeholder - P_GivePlayerLives(&players[maxlivesplayer], -1); - P_GivePlayerLives(player, 1); + players[maxlivesplayer].lives--; + player->lives++; if (netgame && P_IsLocalPlayer(player)) S_ChangeMusic(mapmusname, mapmusflags, true); else if (player == &players[displayplayer] || player == &players[secondarydisplayplayer])