]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
merge some changes from my autocvarizer branch that change nothing but make code...
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 11:36:37 +0000 (12:36 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 11:36:37 +0000 (12:36 +0100)
19 files changed:
balance25.cfg
balanceLeeStricklin.cfg
balanceSamual.cfg
balanceXonotic.cfg
balancetZork.cfg
qcsrc/server/campaign.qc
qcsrc/server/cheats.qh
qcsrc/server/cl_client.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/monsters/ai.qc
qcsrc/server/monsters/defs.qc
qcsrc/server/monsters/mode_management.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/teamplay.qc
qcsrc/server/vote.qc
qcsrc/server/w_campingrifle.qc
qcsrc/server/w_rocketlauncher.qc

index d316ce82326806d006fc141b8a54763fb9d7f8e6..32ec280e0074dddf65d0086b1bf1872272c45b45 100644 (file)
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 0
 set g_balance_campingrifle_primary_damage 60
index 064b72c76272fe5052825f0d601e668f2b55b884..4e213f2ca16f4ab27a55a56a4bf5e18cc83dca3c 100644 (file)
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
 set g_balance_campingrifle_primary_tracer 0
 set g_balance_campingrifle_primary_damage 75
index c39a9c64633a43936074fab71f69caf2b43fb7fd..65a728c056570ba312891e0e7b8c6deb0cd364c3 100644 (file)
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
 set g_balance_campingrifle_primary_damage 65
index 1edf010f36baf0e5104ef49cfb42684262848953..94bd626729bc36d25c9463d801e702413739d69b 100644 (file)
@@ -607,7 +607,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
 set g_balance_campingrifle_primary_damage 70
index 2da45b691061bf08ba703a304ebd9810a0df333b..8efcb202fd81f0c7249feea1bfd985f46d5ac5d4 100644 (file)
@@ -623,7 +623,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
 set g_balance_campingrifle_primary_damage 40
index 1a8db10af5238ff5c7fe15acdd50f765b306bafb..816f71bf9d683445d12195f54ec3b0c8bb4ae681 100644 (file)
@@ -64,7 +64,7 @@ void CampaignPreInit()
 {
        float baseskill;
        string title;
-       if(cvar("sv_cheats"))
+       if(autocvar_sv_cheats)
        {
                CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))");
                return;
@@ -101,7 +101,7 @@ void CampaignPreInit()
 
        // copy sv_gravity cvar, as the engine needs it too (sorry, this will mess
        // with the menu a little still...)
-       cvar_set_normal("sv_gravity", cvar_string("sv_gravity"));
+       cvar_set_normal("sv_gravity", ftos(cvar("sv_gravity")));
 
        if(Campaign_Invalid())
                return;
index cb365a3ba46f6363c73bdce67c0c2813cce5aa53..8c276919c51082206169b6050dd44335d7d1fc84 100644 (file)
@@ -1,3 +1,5 @@
+float autocvar_sv_cheats; // must... declare... global
+
 float cheatcount_total;
 .float cheatcount;
 void CheatInit();
index a1a8c4f900ad0a959e5993c09746868d8cb955a1..0183f2dbd10f4bee13986c3e68e3ca549f112b43 100644 (file)
@@ -802,8 +802,8 @@ void FixPlayermodel()
 
        if(!teams_matter)
                if(strlen(cvar_string("sv_defaultplayercolors")))
-                       if(self.clientcolors != cvar("sv_defaultplayercolors"))
-                               setcolor(self, cvar("sv_defaultplayercolors"));
+                       if(self.clientcolors != stof(cvar_string("sv_defaultplayercolors")))
+                               setcolor(self, stof(cvar_string("sv_defaultplayercolors")));
 }
 
 void PlayerTouchExplode(entity p1, entity p2)
index fd5b445eba8664746b8ad43f64738e3ad0534fd7..52f756ea7386810a84aaf30fa670caf7bbc0cc35 100644 (file)
@@ -877,14 +877,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
 
        if(RadiusDamage_running)
        {
-               string save;
-               print("RadiusDamage called recursively!\n");
-               print("Expect stuff to go HORRIBLY wrong.\n");
-               print("Causing a stack trace...\n");
-               save = cvar_string("prvm_backtraceforwarnings");
-               cvar_set("prvm_backtraceforwarnings", "1");
-               fclose(-1); // calls VM_Warning
-               cvar_set("prvm_backtraceforwarnings", save);
+               backtrace("RadiusDamage called recursively! Expect stuff to go HORRIBLY wrong.");
                return 0;
        }
 
index 9a3c3614a25de91e4bab9259f6e5e142431c12cb..27d7a69c7cb369e89fa55c6556c30de10c6bd582 100644 (file)
@@ -614,15 +614,6 @@ void spawnfunc_worldspawn (void)
 
        TemporaryDB = db_create();
 
-       /*
-       TODO sound pack system
-       // initialize sound pack system
-       soundpack = cvar_string("g_soundpack");
-       if(soundpack != "")
-               soundpack = strcat(soundpack, "/");
-       soundpack = strzone(soundpack);
-       */
-
        // 0 normal
        lightstyle(0, "m");
 
@@ -696,7 +687,7 @@ void spawnfunc_worldspawn (void)
        GameLogInit(); // prepare everything
        if(cvar("sv_eventlog"))
        {
-               s = strcat(cvar_string("sv_eventlog_files_counter"), ".");
+               s = strcat(ftos(cvar("sv_eventlog_files_counter")), ".");
                s = strcat(s, ftos(random()));
                matchid = strzone(s);
 
index cb74c8d3a8a926148704766a302c6ab9004284b1..a5b33acf7d4f526b0a765dbc7ef2f1f02ee44a33 100644 (file)
@@ -794,6 +794,8 @@ vector randompos(vector m1, vector m2)
     return  v;
 };
 
+//#NO AUTOCVARS START
+
 float g_pickup_shells;
 float g_pickup_shells_max;
 float g_pickup_nails;
@@ -1313,25 +1315,7 @@ void readlevelcvars(void)
        readplayerstartcvars();
 }
 
-/*
-// TODO sound pack system
-string soundpack;
-
-string precache_sound_builtin (string s) = #19;
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
-string precache_sound(string s)
-{
-       return precache_sound_builtin(strcat(soundpack, s));
-}
-void play2(entity e, string filename)
-{
-       stuffcmd(e, strcat("play2 ", soundpack, filename, "\n"));
-}
-void sound(entity e, float chan, string samp, float vol, float atten)
-{
-       sound_builtin(e, chan, strcat(soundpack, samp), vol, atten);
-}
-*/
+//#NO AUTOCVARS END
 
 // Sound functions
 string precache_sound (string s) = #19;
index 23330cdfc22a8f24ddf65ee3344655538a44db26..022fde20152fec14ba2b6e223308569b6b146ff8 100644 (file)
@@ -188,6 +188,7 @@ void() monster_spawnwanderpath =
 
 void() monster_checkbossflag =
 {
+//#NO AUTOCVARS START
 #if 0
        local float healthboost;
        local float r;
@@ -222,6 +223,7 @@ void() monster_checkbossflag =
                while (self.colormod_x > 0.6 && self.colormod_y > 0.6 && self.colormod_z > 0.6);
        }
 #endif
+//#NO AUTOCVARS END
 };
 
 
index 1a43fc78ea8d89a026b6b8406fe27318ca0e834b..19821429c3d7b46f4f6aa09a77ce626de9688556 100644 (file)
@@ -40,12 +40,14 @@ float   AS_MISSILE              = 4;
 float SKILL4_MINALPHA         = 0.4;
 
 float monsterwander;
+//#NO AUTOCVARS START
 /*
         monsterwander = cvar("monsterwander");
         // monsterwander is always on in skill 5
         if (skill >= 5)
                 monsterwander = TRUE;
 */
+//#NO AUTOCVARS END
 
 .float candrown;
 
index 9f3770ff26bf068a47e7998c0a0f0cba683a1e81..5b7d80facae461174a6cae6798eca15d3afd5718 100644 (file)
@@ -164,14 +164,14 @@ string dmmessage;
 void(string m) setdm =
 {
        dmmessage = m;
-       if (cvar_string("deathmatch") != m)
+       if (cvar("deathmatch") != stof(m))
                cvar_set("deathmatch", m);
 }
 
 void(string m) setteamplay =
 {
        dmmessage = m;
-       if (cvar_string("teamplay") != m)
+       if (cvar("teamplay") != stof(m))
                cvar_set("teamplay", m);
 }
 
index ca2865a2162e49c73a39a88f2efd59879dddbed9..54be69cb11f3eb06c1629e5dd5563107b30aa348 100644 (file)
@@ -2,7 +2,6 @@
 
 // #define KH_PLAYER_USE_ATTACHMENT
 // #define KH_PLAYER_USE_CARRIEDMODEL
-// #define KH_KEY_ATTACHMENT_DEBUG
 
 #ifdef KH_PLAYER_USE_ATTACHMENT
 vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
@@ -648,17 +647,6 @@ void kh_Key_Think()  // runs all the time
        if(intermission_running)
                return;
 
-#ifdef KH_KEY_ATTACHMENT_DEBUG
-       if(self.kh_prev == self.owner)
-       {
-               if(cvar_string("_angles") != "")
-               {
-                       self.angles = stov(cvar_string("_angles"));
-                       setorigin(self, stov(cvar_string("_origin")));
-               }
-       }
-#endif
-
        if(self.owner)
        {
 #ifndef KH_PLAYER_USE_ATTACHMENT
index 7df082c8747475d3b6d8fd0e3fb116ecca519fee..262b5e98bae1a6ca4fae3df2d29a0b93f3663cf1 100644 (file)
@@ -115,6 +115,7 @@ void ReadGameCvars()
        prev = cvar("gamecfg");
        for(i = 0; i < 2; ++i)
        {
+//#NO AUTOCVARS START
                found += (g_dm = (!found && (prev != GAME_DEATHMATCH) && cvar("g_dm")));
                found += (g_tdm = (!found && (prev != GAME_TEAM_DEATHMATCH) && cvar("g_tdm")));
                found += (g_domination = (!found && (prev != GAME_DOMINATION) && cvar("g_domination")));
@@ -131,6 +132,7 @@ void ReadGameCvars()
                found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));
                found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag")));
                found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway")));
+//#NO AUTOCVARS END
 
                if(found)
                        break;
@@ -431,7 +433,7 @@ void InitGameplayMode()
                        race_timelimit = cvar("timelimit");
                        cvar_set("fraglimit", "0");
                        cvar_set("leadlimit", "0");
-                       cvar_set("timelimit", cvar_string("g_race_qualifying_timelimit"));
+                       cvar_set("timelimit", ftos(cvar("g_race_qualifying_timelimit")));
                }
                else
                        g_race_qualifying = 0;
index 1fbdecad9fdf6714fff928c760ab9444eb140a35..adc037c833b60bf757dc76cbf179447e0aee3252 100644 (file)
@@ -55,7 +55,7 @@ entity GetKickVoteVictim(string vote, string cmd, entity caller)
                GetKickVoteVictim_newcommand = strcat(argv(0), " # ", ftos(num_for_edict(e)));
                if(argv(0) == "kickban")
                {
-                       GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", cvar_string("g_ban_default_bantime"), " ", cvar_string("g_ban_default_masksize"), " ", reason);
+                       GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", ftos(cvar("g_ban_default_bantime")), " ", ftos(cvar("g_ban_default_masksize")), " ", reason);
                }
                else if(argv(0) == "kick")
                {
@@ -367,7 +367,7 @@ void VoteHelp(entity e) {
        print_to(e, "^7\"^2yes^7\", \"^2no^7\", \"^2abstain^7\" and \"^2dontcare^7\" to make your vote.");
        print_to(e, "^7If enough of the players vote yes the vote is accepted.");
        print_to(e, "^7If enough of the players vote no the vote is rejected.");
-       print_to(e, strcat("^7If neither the vote will timeout after ", cvar_string("sv_vote_timeout"), "^7 seconds."));
+       print_to(e, strcat("^7If neither the vote will timeout after ", ftos(cvar("sv_vote_timeout")), "^7 seconds."));
        print_to(e, "^7You can call a vote for or execute these commands:");
        print_to(e, strcat("^3", cvar_string("sv_vote_commands"), "^7 and maybe further ^3arguments^7"));
 }
index 309717305052fefb239085d85a8ed1ff41b5b103..1347fc88c94baae7678661584e54be2c68c2be15 100644 (file)
@@ -250,7 +250,7 @@ float w_campingrifle(float req)
                weapon_setup(WEP_CAMPINGRIFLE);
 
                full = W_CampingRifle_CheckMaxBullets(TRUE);
-               if(cvar("g_balance_campingrifle_auto_reload_after_changing_weapons"))
+               if(cvar("g_balance_campingrifle_auto_reload_on_switch"))
                        if(!full)
                                self.campingrifle_bulletcounter = -1;
        }
index b42a4482899571dbf2967c8519855f3478e8b59c..cbc458f5b91fd780d7625d4095353dea20c57976 100644 (file)
@@ -196,17 +196,6 @@ void W_Rocket_Think (void)
                        desiredorigin = WarpZone_RefSys_TransformOrigin(self.owner, self, self.owner.origin + self.owner.view_ofs);
                        olddir = normalize(self.velocity);
 
-#if 0
-                       // disabled this code because it doesn't do what I want it to do :P
-                       cosminang = cos(cvar("g_balance_rocketlauncher_guidefadeangle") * DEG2RAD);
-                       cosmaxang = cos(cvar("g_balance_rocketlauncher_guidemaxangle") * DEG2RAD);
-                       cosang = desireddir * normalize(self.origin - desiredorigin);
-                       if(cosminang == cosmaxang)
-                               f *= (cosang >= cosminang);
-                       else
-                               f *= bound(0, (cosang - cosmaxang) / (cosminang - cosmaxang), 1);
-#endif
-
                        // now it gets tricky... we want to move like some curve to approximate the target direction
                        // but we are limiting the rate at which we can turn!
                        goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + cvar("g_balance_rocketlauncher_guidegoal")) * desireddir;