]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/combined_updates
authorSamual Lenks <samual@xonotic.org>
Thu, 24 Oct 2013 18:38:46 +0000 (14:38 -0400)
committerSamual Lenks <samual@xonotic.org>
Thu, 24 Oct 2013 18:38:46 +0000 (14:38 -0400)
defaultXonotic.cfg
qcsrc/client/progs.src
qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail [deleted file]
qcsrc/common/util.qh
qcsrc/menu/progs.src
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/progs.src

index 128fe8b5550980bb867d441ca8f96b1bddeadb44..783fe06148a313c4f733b760c189921ae24769a7 100644 (file)
@@ -238,7 +238,7 @@ set g_maxplayers_spectator_blocktime 5      "if the players voted for the \"nospectat
 set g_warmup 0 "split the game into a warmup- and match-stage when set to 1"
 set g_warmup_limit 0   "if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage, otherwise warmup will be limited to this time in SECONDS (useful for public matches)"
 set g_warmup_allow_timeout 0   "if set to 1 timeouts can also be called in the warmup-stage, when sv_timeout is set to 1"
-set g_warmup_allguns 1 "if set players start with all guns in warmup mode"
+set g_warmup_allguns 1 "provide more weapons on start while in warmup: 0 = normal start weapons, 1 = all guns available on the map, 2 = all normal weapons"
 set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end"
 
 set g_chat_nospectators 0      "if 0 spec/observer chat is always visible to the player, if 1 it is never visible to players, if 2 it is only visible to players during warmup stage"
@@ -1437,7 +1437,7 @@ sv_cullentities_trace 1
 r_cullentities_trace 0
 
 // less "lagging" of other players, but also less PL tolerant... let's try this
-sv_clmovement_inputtimeout 0.07 // more than 2, less than 3 server frames
+sv_clmovement_inputtimeout 0.04 // more than 1, less than 2 server frames
 
 // exact gloss looks better, e.g. on g-23
 r_shadow_glossexact 1
index 1bae6f980ce9cd9d232dd6f4cdf52f9f7f339fdc..5c999895bd019a1c3a70b4d11df6d197df9741ee 100644 (file)
@@ -123,5 +123,3 @@ tturrets.qc
 
 player_skeleton.qc
 ../common/animdecide.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
diff --git a/qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail b/qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
deleted file mode 100644 (file)
index e69de29..0000000
index f61df67a1a20f4bafe829666597d9eca9ee60ea2..3cb3b35d2b034d133fa24faf69ed9663b32bc9be 100644 (file)
@@ -6,6 +6,12 @@
 // a dummy macro that prevents the "hanging ;" warning
 #define ENDS_WITH_CURLY_BRACE
 
+#ifdef GMQCC
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+       [[accumulate]] void func() { otherfunc(); }
+# define CALL_ACCUMULATED_FUNCTION(func) \
+       func()
+#else
 #ifdef HAVE_YO_DAWG_CPP
 // TODO make ascii art pic of xzibit
 // YO DAWG!
@@ -41,6 +47,7 @@ void ACCUMULATE_call(string func)
 # define CALL_ACCUMULATED_FUNCTION(func) \
        ACCUMULATE_call(#func)
 #endif
+#endif
 
 // used for simplifying ACCUMULATE_FUNCTIONs
 #define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
index f0e0bd748baac04bf73039b1e67ef4580986e6c1..b0aad676efedfb436386fbefa631e1dfb4b776e8 100644 (file)
@@ -56,5 +56,3 @@ xonotic/util.qc
 ../common/urllib.qc
 
 ../warpzonelib/mathlib.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
index f04fc8472288e11ae3b9c6e3da1a0c47e4ed6e82..53c1853a7faeeb056123eab23d3f3ab13f5812ca 100644 (file)
@@ -718,7 +718,7 @@ float CheatCommand(float argc)
        END_CHEAT_FUNCTION();
 }
 
-float Drag(entity e, float grab, float ischeat);
+float Drag(float force_allow_pick, float ischeat);
 void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
 void Drag_Finish(entity dragger);
 float Drag_IsDraggable(entity draggee);
@@ -748,40 +748,11 @@ float CheatFrame()
                        {
                                // use cheat dragging if cheats are enabled
                                crosshair_trace_plusvisibletriggers(self);
-                               Drag(trace_ent, TRUE, TRUE);
+                               Drag(TRUE, TRUE);
                        }
                        else
                        {
-                               // drag is TRUE if the object can be picked up. While an object is being carried, the Drag() function
-                               // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
-                               // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
-                               // it goes out of range while slinging it around.
-
-                               float drag;
-                               crosshair_trace_plusvisibletriggers(self);
-                               drag = FALSE;
-                               if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range)
-                               {
-                                       switch(trace_ent.grab)
-                                       {
-                                               case 0: // can't grab
-                                                       break;
-                                               case 1: // owner can grab
-                                                       if(trace_ent.owner == self || trace_ent.realowner == self)
-                                                               drag = TRUE;
-                                                       break;
-                                               case 2: // owner and team mates can grab
-                                                       if(SAME_TEAM(trace_ent.owner, self) || SAME_TEAM(trace_ent.realowner, self) || trace_ent.team == self.team)
-                                                               drag = TRUE;
-                                                       break;
-                                               case 3: // anyone can grab
-                                                       drag = TRUE;
-                                                       break;
-                                               default:
-                                                       break;
-                                       }
-                               }
-                               Drag(trace_ent, drag, FALSE); // execute dragging
+                               Drag(FALSE, FALSE); // execute dragging
                        }
                        break;
        }
@@ -795,7 +766,7 @@ float CheatFrame()
 
 // ENTITY DRAGGING
 
-float Drag(entity e, float pick, float ischeat)
+float Drag(float force_allow_pick, float ischeat)
 {
        BEGIN_CHEAT_FUNCTION();
 
@@ -840,9 +811,42 @@ float Drag(entity e, float pick, float ischeat)
                        else
                        {
                                if(Drag_CanDrag(self))
-                                       if(self.BUTTON_DRAG && pick)
+                                       if(self.BUTTON_DRAG)
                                        {
-                                               if(e)
+                                               crosshair_trace_plusvisibletriggers(self);
+                                               entity e = trace_ent;
+                                               float pick = force_allow_pick;
+                                               if (e && !pick)
+                                               {
+                                                       // pick is TRUE if the object can be picked up. While an object is being carried, the Drag() function
+                                                       // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
+                                                       // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
+                                                       // it goes out of range while slinging it around.
+
+                                                       if(vlen(self.origin - e.origin) <= autocvar_g_grab_range)
+                                                       {
+                                                               switch(e.grab)
+                                                               {
+                                                                       case 0: // can't grab
+                                                                               break;
+                                                                       case 1: // owner can grab
+                                                                               if(e.owner == self || e.realowner == self)
+                                                                                       pick = TRUE;
+                                                                               break;
+                                                                       case 2: // owner and team mates can grab
+                                                                               if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
+                                                                                       pick = TRUE;
+                                                                               break;
+                                                                       case 3: // anyone can grab
+                                                                               pick = TRUE;
+                                                                               break;
+                                                                       default:
+                                                                               break;
+                                                               }
+                                                       }
+                                               }
+                                               // Find e and pick
+                                               if(e && pick)
                                                        if(Drag_IsDraggable(e))
                                                        {
                                                                if(ischeat)
index cdd3592a789535a1eced4bb7589659c1afc4d02d..ff82a4ddf731eec3ce8b58016d9d1b2d99322a10 100644 (file)
@@ -439,7 +439,7 @@ void PutClientInServer (void)
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
-                       self.weapons = warmup_start_weapons;
+                       self.weapons = WARMUP_START_WEAPONS;
                }
                else
                {
index 1c5daa19f1eb7999d4541a8f586c2de5332e9834..63924e60fe91acd5b0fc08f29ea31cec66c3b022 100644 (file)
@@ -353,7 +353,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                ear1 += v_right * -10;
                ear2 += v_right * +10;
                d = inflictor.origin - self.origin;
-               f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               if (d)
+                       f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               else
+                       f = 0;  // Assum ecenter.
                force = v_right * vlen(force);
                Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
                Violence_GibSplash_At(ear2, force,      2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
index c01cddd216a45bbdee98ba5c4c7e57767aaacd29..15b7a62bf2e0f0f9e53ffe673c6cd3c7436e42f1 100644 (file)
@@ -128,7 +128,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                        }
 
                        if(warmup_stage)
-                               GiveFrags_randomweapons.weapons = warmup_start_weapons;
+                               GiveFrags_randomweapons.weapons = WARMUP_START_WEAPONS;
                        else
                                GiveFrags_randomweapons.weapons = start_weapons;
 
index d6c1cf1d6dd36e7163dd9c9eb3ce267f8ef3ca2d..62f05b0887eaccfe9b2e0ffecf1902557a2b6feb 100644 (file)
@@ -615,6 +615,7 @@ float start_armorvalue;
 WepSet warmup_start_weapons;
 WepSet warmup_start_weapons_default;
 WepSet warmup_start_weapons_defaultmask;
+#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -834,7 +835,7 @@ void readplayerstartcvars()
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
+                               float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
@@ -858,10 +859,13 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
 
+       WepSet precache_weapons = start_weapons;
+       if (g_warmup_allguns != 1)
+               precache_weapons |= warmup_start_weapons;
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                e = get_weaponinfo(i);
-               if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
+               if(precache_weapons & WepSet_FromWeapon(i))
                        weapon_action(i, WR_PRECACHE);
        }
 
index 2e42a3c4bdfbbe37f3b5cd8779e6ecb36133de47..3dbdc454f0bbb4cd97ac7758605a18b65481c700 100644 (file)
@@ -269,5 +269,3 @@ mutators/mutator_campcheck.qc
 ../common/test.qc
 ../common/util.qc
 ../common/notifications.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail