]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/okc
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 25 Aug 2017 15:08:43 +0000 (17:08 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 25 Aug 2017 15:08:43 +0000 (17:08 +0200)
15 files changed:
.gitlab-ci.yml
defaultClient.cfg
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/common/monsters/sv_spawn.qc
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/client.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/tracing.qc
scripts/ok_nade_counter.shader

index 732c773ccdba6523537ccd98cbde4184c9841527..5d525a4c5773a647cd82ee8e27bd338b927153f0 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=ae8189deefd88a6f2f8c22b0da186691
+    - EXPECT=662ab75eeb91d25c2d86ebb81ce8dc02
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 7aa1ad5cf07afc03f9d6fb879693ea649ee4789a..c12f69feeb86b881f59ebff7d52fda05d4445946 100644 (file)
@@ -269,7 +269,7 @@ r_shadow_realtime_world_lightmaps 1
 r_shadow_realtime_world_importlightentitiesfrommap 0 // Whether build process uses keepLights is nontransparent and may change, so better make keepLights not matter.
 cl_decals_fadetime 5
 cl_decals_time 1
-seta cl_gunalign 3 "Gun alignment; 1 = center (if allowed by g_shootfromclient) or right, 2 = center (if allowed by g_shootfromclient) or left, 3 = right only, 4 = left only"
+seta cl_gunalign 3 "Gun alignment; 1 = center, 3 = right, 4 = left; requires reconnect"
 seta cl_nogibs 0 "reduce number of violence effects, or remove them totally"
 seta cl_particlegibs 0 "simpler gibs"
 seta cl_gibs_damageforcescale 3.5 "force to push around gibs"
index 34ecd834f7ec682ca1e6c1c00d9f8164928e783a..3a11bdb1e7f0085aba298ff439644428dfc7e253 100644 (file)
@@ -153,13 +153,12 @@ float SetTeam(entity pl, float Team);
 //float lastpnum;
 void Scoreboard_UpdatePlayerTeams()
 {
-       float Team;
        entity pl, tmp;
        //int num = 0;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                //num += 1;
-               Team = entcs_GetScoreTeam(pl.sv_entnum);
+               int Team = entcs_GetScoreTeam(pl.sv_entnum);
                if(SetTeam(pl, Team))
                {
                        tmp = pl.sort_prev;
index 64b340622a16a2ee2a3ea5f87d98efb97b1d3ea6..7ad10879f7ac23b05a69a96ae7d4f7441ea51c2d 100644 (file)
@@ -152,6 +152,9 @@ void CSQC_Init()
 
        GetTeam(NUM_SPECTATOR, true); // add specs first
 
+       for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
+               weapon_accuracy[w] = -1;
+
        // precaches
 
        if(autocvar_cl_reticle)
@@ -493,9 +496,9 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
 
     int f = ReadByte();
 
-       scoreboard_showscores_force = (f & 1);
+       scoreboard_showscores_force = (f & BIT(0));
 
-       if(f & 2)
+       if(f & BIT(1))
        {
                newspectatee_status = ReadByte();
                if(newspectatee_status == player_localnum + 1)
@@ -504,9 +507,9 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
        else
                newspectatee_status = 0;
 
-       spectatorbutton_zoom = (f & 4);
+       spectatorbutton_zoom = (f & BIT(2));
 
-       if(f & 16)
+       if(f & BIT(4))
        {
                num_spectators = ReadByte();
 
index 4bbe2ce3d8f8a94fc336a0165e8009d0c16b0767..d6989ad31839d52229cc8f612879fd6c83ab8686 100644 (file)
@@ -16,11 +16,12 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby,
        //if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; }
 
        setorigin(e, orig);
+       bool allow_any = boolean(monster == "anyrandom");
 
-       if(monster == "random")
+       if(monster == "random" || allow_any)
        {
                RandomSelection_Init();
-               FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN),
+               FOREACH(Monsters, it != MON_Null && (allow_any || (!(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN))),
                {
                        RandomSelection_AddEnt(it, 1, 1);
                });
index 0e170e57ec6249fd4e3ed9e82a284145f691a078..4a18cc930879ad34e28ef7551c7af1e381bf8d46 100644 (file)
@@ -1,13 +1,13 @@
 #include "sv_damagetext.qh"
 
-AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players");
+AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage");
 
 REGISTER_MUTATOR(damagetext, true);
 
-#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 /* disabled */)
-#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1 /* spectators only */)
-#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2 /* players */)
-#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3 /* all players */)
+#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 || autocvar_g_instagib)
+#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
+#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2)
+#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3)
 MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
     if (SV_DAMAGETEXT_DISABLED()) return;
     const entity attacker = M_ARGV(0, entity);
index 63d98b4d6ea2edeb971988435daf61e8d8543fa4..11926b36d025b263032e2c1cf6355094c1305802 100644 (file)
@@ -1479,11 +1479,6 @@ MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
        M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
 }
 
-MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
-{
-       M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Nades");
-}
-
 MUTATOR_HOOKFUNCTION(nades, BuildGameplayTipsString)
 {
        M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3nades^8 are enabled, press 'g' to use them\n");
index ea2e2e1730546bc7686b65b55172063a04b00f1a..4be22446bf9dae2f8a314138be4e4b4fd4909426 100644 (file)
@@ -198,6 +198,7 @@ const int WEP_TYPE_MELEE_PRI      = 0x400; // primary attack is melee swing (for
 const int WEP_TYPE_MELEE_SEC      = 0x800; // secondary attack is melee swing (for animation)
 const int WEP_FLAG_DUALWIELD      = 0x1000; // weapon can be dual wielded
 const int WEP_FLAG_NODUAL         = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
+const int WEP_FLAG_PENETRATEWALLS = 0x4000; // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO)
 
 // variables:
 string weaponorder_byid;
index 29520f5455bcbdb36d69b6dc8586fba85dfd3ffc..ed5496f050f28cb841949a0937ebd4a279c589d6 100644 (file)
@@ -3,7 +3,7 @@
 CLASS(Rifle, Weapon)
 /* ammotype  */ ATTRIB(Rifle, ammo_field, .int, ammo_nails);
 /* impulse   */ ATTRIB(Rifle, impulse, int, 7);
-/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
+/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
 /* rating    */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
 /* color     */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
 /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
index feb19afe1f921b25fec4c0422555482c70ff1b43..8f2abb3f824b5745448a5fb4c16ab21545e5451b 100644 (file)
@@ -307,7 +307,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
 
        // decide whether to fire this time
-       if ((normalize(v) * shotdir) >= cos(maxfiredeviation * DEG2RAD))
+       if (v * shotdir >= cos(maxfiredeviation * DEG2RAD))
        if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1))
                this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5);
        //traceline(shotorg,shotorg+shotdir*1000,false,NULL);
index 6cb24f0be03581e50e8f0fcb7d603b9376a2eb41..5bc86b84e14ca350c18d75493500cf7ca55da63a 100644 (file)
@@ -630,8 +630,7 @@ float bot_fixcount()
        // only add one bot per frame to avoid utter chaos
        if(time > botframe_nextthink)
        {
-               //dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
-               while (currentbots < bots)
+               if (currentbots < bots)
                {
                        if (bot_spawn() == NULL)
                        {
index b0eb75ae41bd1c1954a3bdad671924a5133b947c..db0e478201de2df4385e257042a8c952019f8aca 100644 (file)
@@ -113,20 +113,18 @@ bool ClientData_Send(entity this, entity to, int sf)
        if (IS_SPEC(e)) e = e.enemy;
 
        sf = 0;
-       if (CS(e).race_completed)       sf |= 1; // forced scoreboard
-       if (CS(to).spectatee_status)    sf |= 2; // spectator ent number follows
-       if (CS(e).zoomstate)            sf |= 4; // zoomed
-       if (autocvar_sv_showspectators) sf |= 16; // show spectators
+       if (CS(e).race_completed)       sf |= BIT(0); // forced scoreboard
+       if (CS(to).spectatee_status)    sf |= BIT(1); // spectator ent number follows
+       if (CS(e).zoomstate)            sf |= BIT(2); // zoomed
+       if (autocvar_sv_showspectators) sf |= BIT(4); // show spectators
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
        WriteByte(MSG_ENTITY, sf);
 
-       if (sf & 2)
-       {
+       if (sf & BIT(1))
                WriteByte(MSG_ENTITY, CS(to).spectatee_status);
-       }
 
-       if(sf & 16)
+       if(sf & BIT(4))
        {
                float specs = CountSpectators(e, to);
                WriteByte(MSG_ENTITY, specs);
index b94b2533f3441a1e5955a13f54214b142e94a398..f69faa03a324de3e93d3136610a2835d9bbc781e 100644 (file)
@@ -84,14 +84,14 @@ void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this)
        this.takedamage = DAMAGE_NO;
        this.event_damage = func_null;
 
+       MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
+
        if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner)
        {
                this.owner = attacker;
                this.realowner = attacker;
        }
 
-       MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
-
        // do not explode NOW but in the NEXT FRAME!
        // because recursive calls to RadiusDamage are not allowed
        this.nextthink = time;
index b5116cf36126e155378761cbcac5fd2db6dec443..8eaa0280a7588fcee50c53a49e73fb23de79c2cc 100644 (file)
@@ -30,7 +30,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
        float oldsolid = ent.dphitcontentsmask;
        if(!IS_CLIENT(ent))
                antilag = false; // no antilag for non-clients!
-       if (IS_PLAYER(ent) && (ent.(weaponentity).m_weapon == WEP_RIFLE || ent.(weaponentity).m_weapon == WEP_MACHINEGUN))
+       if (IS_PLAYER(ent) && (ent.(weaponentity).m_weapon.spawnflags & WEP_FLAG_PENETRATEWALLS))
                ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
        else
                ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
index 130bee7ab023805d72fd02799e399012692b277b..a538eafbb59c29b0ee036b4a1813626abb52c2f1 100644 (file)
@@ -2,7 +2,6 @@ models/ok_nade_counter/ok_nade_counter_01
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_01"
                blendfunc add
@@ -12,7 +11,6 @@ models/ok_nade_counter/ok_nade_counter_02
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_02"
                blendfunc add
@@ -22,7 +20,6 @@ models/ok_nade_counter/ok_nade_counter_03
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_03"
                blendfunc add
@@ -32,7 +29,6 @@ models/ok_nade_counter/ok_nade_counter_04
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_04"
                blendfunc add
@@ -42,7 +38,6 @@ models/ok_nade_counter/ok_nade_counter_05
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_05"
                blendfunc add
@@ -52,7 +47,6 @@ models/ok_nade_counter/ok_nade_counter_06
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_06"
                blendfunc add
@@ -62,7 +56,6 @@ models/ok_nade_counter/ok_nade_counter_07
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_07"
                blendfunc add
@@ -72,7 +65,6 @@ models/ok_nade_counter/ok_nade_counter_08
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_08"
                blendfunc add
@@ -82,9 +74,8 @@ models/ok_nade_counter/ok_nade_counter_09
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        {
                map "models/ok_nade_counter/ok_nade_counter_09"
                blendfunc add
        }
-}
\ No newline at end of file
+}