]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/hud_updates
authorSamual <samual@xonotic.org>
Tue, 25 Oct 2011 15:02:41 +0000 (11:02 -0400)
committerSamual <samual@xonotic.org>
Tue, 25 Oct 2011 15:02:41 +0000 (11:02 -0400)
16 files changed:
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/hud_config.qc
qcsrc/common/util.qh
qcsrc/menu/gamecommand.qc
qcsrc/server/antilag.qc
qcsrc/server/antilag.qh
qcsrc/server/g_subs.qc
qcsrc/server/g_world.qc
qcsrc/server/gamecommand.qc
qcsrc/server/sv_main.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_common.qc

index 9aa81be98e0ccf5b555705bfaf10d1761a0a18bd..7abf7208788d9256deb299ad538dcaa134480d7a 100644 (file)
@@ -354,7 +354,6 @@ float CSQC_ConsoleCommand(string strMessage)
 {
        float argc;
        // Tokenize String
-       //argc = tokenize(strMessage);
        argc = tokenize_console(strMessage);
 
        // Acquire Command
index 077a0d21c0799e94553908e206507f9f6a1dd1b3..5cfe9344779f72c7238f51e577faeb4b3e816f14 100644 (file)
@@ -1463,7 +1463,7 @@ void CSQC_common_hud(void)
             if(acc_color_levels)
                 strunzone(acc_color_levels);
             acc_color_levels = strzone(autocvar_accuracy_color_levels);
-            acc_levels = tokenize(acc_color_levels);
+            acc_levels = tokenize_console(acc_color_levels);
             if (acc_levels > MAX_ACCURACY_LEVELS)
                 acc_levels = MAX_ACCURACY_LEVELS;
 
index a47df3ca4e2e45e424f7ae518d710a85feef6e8e..4c12c90d2a5b8f628360793bae2bac64a136806d 100644 (file)
@@ -627,7 +627,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        string con_keys;
        float keys;
        con_keys = findkeysforcommand("toggleconsole");
-       keys = tokenize(con_keys);
+       keys = tokenize(con_keys); // findkeysforcommand returns data for this
 
        float hit_con_bind, i;
        for (i = 0; i < keys; ++i)
index 2eee6d74ef1a4d369286c1fcc01a71588ccd130d..b2e77484e398695ea3b2febb290bd217cdf83af5 100644 (file)
@@ -22,7 +22,7 @@ void wordwrap_cb(string s, float l, void(string) callback)
 
 float GameCommand_Generic(string cmd);
 // returns TRUE if handled, FALSE otherwise
-// uses tokenize on its argument!
+// tokenizes its input!
 
 // iterative depth-first search, with fields that go "up", "down left" and "right" in a tree
 // for each element, funcPre is called first, then funcPre and funcPost for all its children, and funcPost last
index 83ef53762c914ab5f5ca4cbd255547d14163f7a8..e637bf5aa87a3f71bd43bf99c94f55f1fc5960a7 100644 (file)
@@ -184,44 +184,5 @@ void GameCommand(string theCommand)
                return;
        }
 
-#if 0
-       if(argv(0) == "tokentest")
-       {
-               string s;
-               float i, n;
-
-               print("SANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_builtin(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("INSANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("EMULATED tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_emulation(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-               return;
-       }
-#endif
-
        print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
index 8a628a1bea91e1c5f9e5d5158b176b3eeedfad91..69d291a4ed69018848e0ebccb7c897b250b922d1 100644 (file)
@@ -14,6 +14,9 @@ void antilag_dummy()
 
 void antilag_record(entity e, float t)
 {
+    if(e.vehicle)
+        antilag_record(e.vehicle, t);
+
        if(time < e.(antilag_times[e.antilag_index]))
                return;
        e.antilag_index = e.antilag_index + 1;
@@ -24,6 +27,7 @@ void antilag_record(entity e, float t)
 
        if(e.antilag_debug)
                te_spark(antilag_takebackorigin(e, t - e.antilag_debug), '0 0 0', 32);
+
 }
 
 // finds the index BEFORE t
@@ -75,6 +79,7 @@ vector antilag_takebackorigin(entity e, float t)
 vector antilag_takebackavgvelocity(entity e, float t0, float t1)
 {
        vector o0, o1;
+
        if(t0 >= t1)
                return '0 0 0';
        o0 = antilag_takebackorigin(e, t0);
@@ -84,11 +89,17 @@ vector antilag_takebackavgvelocity(entity e, float t0, float t1)
 
 void antilag_takeback(entity e, float t)
 {
+    if(e.vehicle)
+        antilag_takeback(e.vehicle, t);
+
        e.antilag_saved_origin = e.origin;
        setorigin(e, antilag_takebackorigin(e, t));
 }
 
 void antilag_restore(entity e)
 {
+    if(e.vehicle)
+        antilag_restore(e.vehicle);
+
        setorigin(e, e.antilag_saved_origin);
 }
index 2a7343243dd6e4dc7cfd80d2cd2bd6394928197e..08e33e2e58c07c9ed8f18f703342826f0ddd7949 100644 (file)
@@ -1,5 +1,4 @@
 void antilag_record(entity e, float t);
-float antilag_find(entity e, float t);
 vector antilag_takebackorigin(entity e, float t);
 vector antilag_takebackavgvelocity(entity e, float t0, float t1);
 void antilag_takeback(entity e, float t);
index a908353a4c93b1c5a3116285cb2764c44e429f38..6a62d61b5d423e43debf69ab9461e031c427142c 100644 (file)
@@ -391,12 +391,7 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
                // take players back into the past
                FOR_EACH_PLAYER(player)
                        if(player != forent)
-                       {
-                           antilag_takeback(player, time - lag);
-                           if(player.vehicle)
-                    antilag_takeback(player.vehicle, time - lag);
-                       }
-                               
+                               antilag_takeback(player, time - lag);
        }
 
        // do the trace
@@ -410,12 +405,7 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
        {
                FOR_EACH_PLAYER(player)
                        if(player != forent)
-                       {
-                           antilag_restore(player);
-                           if(player.vehicle)
-                    antilag_restore(player.vehicle);
-                       }
-                               
+                               antilag_restore(player);
        }
 
        // restore shooter solid type
index 6441efe3dca0a00e78a77667e4f85bfcc6f759d2..e1e598db5707a5b66344ac18e937b2bea1650ac7 100644 (file)
@@ -961,7 +961,7 @@ string GetMapname()
 float Map_Count, Map_Current;
 string Map_Current_Name;
 
-// NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
+// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
 float GetMaplistPosition()
 {
        float pos, idx;
@@ -2852,8 +2852,6 @@ void EndFrame()
                self.hitsound = FALSE;
                self.typehitsound = FALSE;
                antilag_record(self, altime);
-               if(self.vehicle)
-            antilag_record(self.vehicle, altime);
        }
 }
 
index f5b662be35e51a5e6a80a72a6ca70ac800cdaaa7..986f2dd84536c7b7141dbe3065a340a817df7d5b 100644 (file)
@@ -596,7 +596,7 @@ void EffectIndexDump()
        fh = fopen("effectinfo.txt", FILE_READ);
        while((s = fgets(fh)))
        {
-               tokenize(s); // tokenize_console would hit the loop counter :(
+               tokenize_console(s);
                if(argv(0) == "effect")
                {
                        if(db_get(d, argv(1)) != "1")
index ce5828affc0194d1c051cf26b3412b6ff2688c61..eb386005d16f16201ba064b01d32e799b1a85bee 100644 (file)
@@ -275,7 +275,7 @@ void SV_OnEntityPreSpawnFunction()
                        s = substring(s, 1, -1);
                }
 
-               n = tokenize(s);
+               n = tokenize_console(s);
                for(i = 0; i < n; ++i)
                {
                        s = argv(i);
index 7595027439bf731bed17c365e38956490f05552a..e3c74c5e190c864a1d0832834729d2fc4b534979 100644 (file)
@@ -273,9 +273,10 @@ float racer_frame()
         return 1;
     }
 
-    
     racer_align4point();
-    vh_crosshair_trace(player);
+
+    crosshair_trace(player);
+
     racer.angles_x *= -1;
 
     // Yaw
index 4712777ee8f7db4f31078f9af528fd40bac9e705..201c186c37947d65ad983efd0b4c67c1f0484120 100644 (file)
@@ -344,7 +344,7 @@ float raptor_frame()
         player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
         return 1;
     }
-    vh_crosshair_trace(player);
+    crosshair_trace(player);
 
     vector vang;
     vang = raptor.angles;
index 00e8f3382372f98529bc75ee8b774401217c66e4..f43ec08e52f35f9a792a172a82c6a9da3e4f0093 100644 (file)
@@ -145,7 +145,7 @@ void spiderbot_rocket_do()
     if not (self.owner.BUTTON_ATCK2)
         return;
 
-    vh_crosshair_trace(self.owner);
+    crosshair_trace(self.owner);
 
     v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
     rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
index 051a9136ef7a21a3f2e919996f1302a86941b050..c4e2875380486575ed766684f7def98d1053ff28 100644 (file)
@@ -111,40 +111,6 @@ void CSQCVehicleSetup(entity own, float vehicle_id)
     dont before calling.
 
 **/
-void vh_crosshair_trace(entity player)
-{
-    float lag; 
-    entity pl;
-    
-    lag = ANTILAG_LATENCY(self);
-    if(lag < 0.001)
-        lag = 0;
-    if(clienttype(self) != CLIENTTYPE_REAL)
-        lag = 0;
-    if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
-        lag = 0; // only do hitscan, but no antilag
-
-    if(lag)
-        FOR_EACH_PLAYER(pl)
-            if(pl != self)
-            {
-                antilag_takeback(pl, time - lag);
-                if(pl.vehicle)
-                    antilag_takeback(pl.vehicle, time - lag);
-
-            }
-
-    crosshair_trace(player);
-
-    if(lag)
-        FOR_EACH_PLAYER(pl)
-            if(pl != self)
-            {
-                antilag_restore(pl);
-                if(pl.vehicle)
-                    antilag_restore(pl.vehicle);
-            }
-}
 .entity lock_target;
 .float  lock_strength;
 .float  lock_time;
@@ -178,7 +144,7 @@ void vehicles_locktarget(float incr, float decr, float _lock_time)
         if(trace_ent.deadflag != DEAD_NO)
             trace_ent = world;
 
-        if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET || trace_ent.classname == "player")
+        if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
             trace_ent = world;
     }
 
index 00a9d2ed09d0a1d5c19ff9d1b1a0709d67534270..1a995191c2f81025e9c9235d145649f0b9f82c42 100644 (file)
@@ -419,13 +419,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                if(lag)
                        FOR_EACH_PLAYER(pl)
                                if(pl != self)
-                               {
-                                   antilag_takeback(pl, time - lag);
-                    if(pl.vehicle)
-                        antilag_takeback(pl.vehicle, time - lag);
-
-                               }
-                                       
+                                       antilag_takeback(pl, time - lag);
 
                oldself = self;
                self = proj;
@@ -504,12 +498,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                if(lag)
                        FOR_EACH_PLAYER(pl)
                                if(pl != self)
-                               {
-                                   antilag_restore(pl);
-                                   if(pl.vehicle)
-                        antilag_restore(pl.vehicle);
-                               }
-                                       
+                                       antilag_restore(pl);
 
                remove(proj);