From: Samual Lenks Date: Thu, 24 Oct 2013 18:11:06 +0000 (-0400) Subject: Merge remote-tracking branch 'origin/master' into samual/serverlist X-Git-Tag: xonotic-v0.8.0~256^2 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=bc20da5a3271b337049a25f68ddecad472b8db98;hp=56e378ae75002cadb9e8908a6562817b682220d4 Merge remote-tracking branch 'origin/master' into samual/serverlist --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 7ba487f6ef..64a542c863 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -237,7 +237,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" @@ -1436,7 +1436,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 diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index 114f0a5b5c..fa61033f65 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -121,5 +121,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 index e69de29bb2..0000000000 diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 0214ec3d61..e8e92f0183 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -230,7 +230,7 @@ void Send_Notification_WOCOVA( MSG_ANNCE_NOTIF(default, prefix##YELLOW, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), volume, position) \ MSG_ANNCE_NOTIF(default, prefix##PINK, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), volume, position) #define MULTITEAM_ANNCE(default,prefix,teams,channel,sound,volume,position) \ - MSG_ANNCE_NOTIF_##teams(default,prefix,channel,sound,volume,position) \ + MULTITEAM_ANNCE##teams(default,prefix,channel,sound,volume,position) #define MSG_ANNCE_NOTIFICATIONS \ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT, CH_INFO, "airshot", VOL_BASEVOICE, ATTEN_NONE) \ diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 10920c3a89..effdb3cf78 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -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); } diff --git a/qcsrc/menu/progs.src b/qcsrc/menu/progs.src index 3036278c1f..4900b9d96b 100644 --- a/qcsrc/menu/progs.src +++ b/qcsrc/menu/progs.src @@ -54,5 +54,3 @@ xonotic/util.qc ../common/urllib.qc ../warpzonelib/mathlib.qc - -../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index f04fc84722..53c1853a7f 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -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) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index fac4314ca6..1ab2b7ab51 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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 { diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 1c5daa19f1..63924e60fe 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index c01cddd216..15b7a62bf2 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 0b5b427812..91e922869b 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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); } diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index e9e9a4b8c8..8980f77594 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -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