added support for skill values outside the range 0-3
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 26 Jan 2005 22:15:34 +0000 (22:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 26 Jan 2005 22:15:34 +0000 (22:15 +0000)
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
pr_edict.c
sv_main.c

diff --git a/menu.c b/menu.c
index f4f66b2..2781af4 100644 (file)
--- 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:
index efb884b..96e73fb 100644 (file)
@@ -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  )))
                {
index 8005c87..75cf370 100644 (file)
--- 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