From c5c61143f3b7c43a194685d0777ef98510308e68 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 26 Jan 2005 22:15:34 +0000 Subject: [PATCH] added support for skill values outside the range 0-3 GAME_TRANSFUSION now uses skill range 0-4 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4971 d7cf8633-e32d-0410-b094-e92efae38249 --- menu.c | 18 ++++++++++++++---- pr_edict.c | 2 +- sv_main.c | 7 ++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/menu.c b/menu.c index f4f66b27..2781af43 100644 --- a/menu.c +++ b/menu.c @@ -3651,10 +3651,20 @@ void M_NetStart_Change (int dir) if (gamemode == GAME_GOODVSBAD2) break; Cvar_SetValueQuick (&skill, skill.integer + dir); - if (skill.integer > 3) - Cvar_SetValueQuick (&skill, 0); - if (skill.integer < 0) - Cvar_SetValueQuick (&skill, 3); + if (gamemode == GAME_TRANSFUSION) + { + if (skill.integer > 4) + Cvar_SetValueQuick (&skill, 0); + if (skill.integer < 0) + Cvar_SetValueQuick (&skill, 4); + } + else + { + if (skill.integer > 3) + Cvar_SetValueQuick (&skill, 0); + if (skill.integer < 0) + Cvar_SetValueQuick (&skill, 3); + } break; case 5: diff --git a/pr_edict.c b/pr_edict.c index efb884bd..96e73fbe 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -1176,7 +1176,7 @@ void ED_LoadFromFile (const char *data) continue; } } - else if ((current_skill == 0 && ((int)ent->v->spawnflags & SPAWNFLAG_NOT_EASY )) + else if ((current_skill <= 0 && ((int)ent->v->spawnflags & SPAWNFLAG_NOT_EASY )) || (current_skill == 1 && ((int)ent->v->spawnflags & SPAWNFLAG_NOT_MEDIUM)) || (current_skill >= 2 && ((int)ent->v->spawnflags & SPAWNFLAG_NOT_HARD ))) { diff --git a/sv_main.c b/sv_main.c index 8005c874..75cf3703 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1642,9 +1642,10 @@ void SV_SpawnServer (const char *server) // if (coop.integer) Cvar_SetValue ("deathmatch", 0); - current_skill = bound(0, (int)(skill.value + 0.5), 3); - - Cvar_SetValue ("skill", (float)current_skill); + // LordHavoc: it can be useful to have skills outside the range 0-3... + //current_skill = bound(0, (int)(skill.value + 0.5), 3); + //Cvar_SetValue ("skill", (float)current_skill); + current_skill = (int)(skill.value + 0.5); // // set up the new server -- 2.39.2