diff --git a/docs/rh-log.txt b/docs/rh-log.txt index e2e8857a7..ac3169b16 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ December 14, 2007 +- Fixed: G_QueueBody() should only change the translation to one of its + private slots if the one currently used is a player range. +- Fixed: Changing the fraglimit during the middle of a game would not trigger + a level change if somebody was already over the new limit. - Added "\c" support to ParseCommandLine() when it parses quoted strings. - Fixed: When changing your name from the menu, you got an extra " appended to your name if it ended with a backslash. diff --git a/src/d_main.cpp b/src/d_main.cpp index 81a088a18..7dda98c82 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -150,7 +150,24 @@ extern cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles; // PUBLIC DATA DEFINITIONS ------------------------------------------------- -CVAR (Int, fraglimit, 0, CVAR_SERVERINFO); +CUSTOM_CVAR (Int, fraglimit, 0, CVAR_SERVERINFO) +{ + // Check for the fraglimit being hit because the fraglimit is being + // lowered below somebody's current frag count. + if (deathmatch && self > 0) + { + for (int i = 0; i < MAXPLAYERS; ++i) + { + if (playeringame[i] && self <= D_GetFragCount(&players[i])) + { + Printf ("%s\n", GStrings("TXT_FRAGLIMIT")); + G_ExitLevel (0, false); + break; + } + } + } +} + CVAR (Float, timelimit, 0.f, CVAR_SERVERINFO); CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR (String, defaultiwad, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG); diff --git a/src/g_game.cpp b/src/g_game.cpp index 038b6aeef..b9d4ad6c3 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1394,10 +1394,14 @@ static void G_QueueBody (AActor *body) } bodyque[modslot] = body; - // Copy the player's translation in case they respawn as something that uses - // a different translation range. - R_CopyTranslation (TRANSLATION(TRANSLATION_PlayerCorpses,modslot), body->Translation); - body->Translation = TRANSLATION(TRANSLATION_PlayerCorpses,modslot); + // Copy the player's translation, so that if they change their color later, only + // their current body will change and not all their old corpses. + if (GetTranslationType(body->Translation) == TRANSLATION_Players || + GetTranslationType(body->Translation) == TRANSLATION_PlayersExtra) + { + R_CopyTranslation (TRANSLATION(TRANSLATION_PlayerCorpses,modslot), body->Translation); + body->Translation = TRANSLATION(TRANSLATION_PlayerCorpses,modslot); + } bodyqueslot++; } diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index e7d968e30..84ea8ce49 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -532,7 +532,7 @@ void AActor::Die (AActor *source, AActor *inflictor) // [RH] Implement fraglimit if (deathmatch && fraglimit && - fraglimit == D_GetFragCount (source->player)) + fraglimit <= D_GetFragCount (source->player)) { Printf ("%s\n", GStrings("TXT_FRAGLIMIT")); G_ExitLevel (0, false); diff --git a/src/r_draw.h b/src/r_draw.h index 74be88219..b0308e80f 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -223,6 +223,10 @@ inline WORD TRANSLATION(BYTE a, BYTE b) { return (a<<8) | b; } +inline int GetTranslationType(WORD trans) +{ + return trans >> 8; +} const int MAX_ACS_TRANSLATIONS = 255; const int MAX_DECORATE_TRANSLATIONS = 255;