]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into DefaultUser/func_train_random_target 385/head
authorMario <mario@smbclan.net>
Tue, 8 Nov 2016 03:37:22 +0000 (13:37 +1000)
committerMario <mario@smbclan.net>
Tue, 8 Nov 2016 03:37:22 +0000 (13:37 +1000)
13 files changed:
.gitlab-ci.yml
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/tuba.qh
qcsrc/menu/xonotic/dialog_uid2name.qh
qcsrc/menu/xonotic/serverlist.qh

index 3c251dccc6bab8b822b9bf94bd5fb2e2c1d54d9e..3c4126b01d23bcbf383052bdaaffb6592f85ef32 100644 (file)
@@ -30,7 +30,7 @@ test_sv_game:
     - wget -O data/maps/g-23.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.cache
     - wget -O data/maps/g-23.waypoints.hardwired https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.hardwired
     - make
-    - EXPECT=0a9ea83e32e148da989cbbadc7421ea0
+    - EXPECT=93decd0a82cf911f02fb5572197db7f3
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index ef68e21b2000808fb0a8cec871bb86abda43ea39..994ff12aa59e4c6ca25a63591638d1e30397b458 100644 (file)
@@ -1121,11 +1121,11 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                int weapon_stats = weapon_accuracy[i - WEP_FIRST];
 
                WepSet set = it.m_wepset;
-               if (weapon_stats < 0)
+               if (weapon_stats < 0 && !((weapons_stat & set) || (weapons_inmap & set)))
                {
-                       if (!(weapons_stat & set) && (it.spawnflags & WEP_FLAG_HIDDEN || it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
-                               nHidden += 1;
-                       else if (!(weapons_stat & set || weapons_inmap & set))
+                       if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED)))
+                               ++nHidden;
+                       else
                                ++disownedcnt;
                }
        });
@@ -1199,7 +1199,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                int weapon_stats = weapon_accuracy[i - WEP_FIRST];
 
                WepSet set = it.m_wepset;
-               if (weapon_stats < 0 && !(weapons_stat & set || weapons_inmap & set))
+               if (weapon_stats < 0 && !((weapons_stat & set) || (weapons_inmap & set)))
                        continue;
 
                float weapon_alpha;
index d309f4d9a757a44feaa13089473b52d2f1986d45..12f4c6a1d0e68e5b72ebb0a475d31c5dee265045 100644 (file)
@@ -22,6 +22,8 @@
 #include <common/triggers/target/music.qh>
 #include <common/teams.qh>
 
+#include <common/weapons/weapon/tuba.qh>
+
 #include <common/vehicles/all.qh>
 #include <common/weapons/_all.qh>
 #include <common/viewloc.qh>
@@ -312,6 +314,12 @@ void viewmodel_draw(entity this)
        {
                static string name_last;
                string name = wep.mdl;
+               if(wep == WEP_TUBA)
+               {
+                       name = (this.tuba_instrument == 0) ? "tuba" :
+                          (this.tuba_instrument == 1) ? "akordeon" :
+                                                    "kleinbottle";
+               }
                bool swap = name != name_last;
                // if (swap)
                {
index 6135e72b556a1aa3d7934fdbc4d631b161981df4..4c6dc15a3c0bff02b9dcaa75435e5789b2c9673f 100644 (file)
@@ -360,6 +360,12 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, SetStartItems)
        start_items |= IT_UNLIMITED_SUPERWEAPONS;
 }
 
+MUTATOR_HOOKFUNCTION(mutator_instagib, SetWeaponArena)
+{
+       // turn weapon arena off
+       M_ARGV(0, string) = "off";
+}
+
 void replace_with_insta_cells(entity item)
 {
        entity e = spawn();
index a8347499841b77d034adb39efac4853400343f29..5bd896ea279fc3178b1f5c3a7c1cdbda94441bbe 100644 (file)
@@ -8,6 +8,12 @@ MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
        start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
 }
 
+MUTATOR_HOOKFUNCTION(melee_only, SetWeaponArena)
+{
+       // turn weapon arena off
+       M_ARGV(0, string) = "off";
+}
+
 MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
 {
        return true;
index 0d804a91427374c74219435695f929a56e84a25f..6ec9c23213f132f95e95993202b74494422f3ce2 100644 (file)
@@ -1174,18 +1174,6 @@ CLASS(NadeOffhand, OffhandWeapon)
     METHOD(NadeOffhand, offhand_think, void(NadeOffhand this, entity player, bool key_pressed))
     {
        entity held_nade = player.nade;
-               if (held_nade)
-               {
-                       player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1);
-                       // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed);
-                       makevectors(player.angles);
-                       held_nade.velocity = player.velocity;
-                       setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0);
-                       held_nade.angles_y = player.angles.y;
-
-                       if (time + 0.1 >= held_nade.wait)
-                               toss_nade(player, false, '0 0 0', time + 0.05);
-               }
 
         if (!CanThrowNade(player)) return;
         if (!(time > player.nade_refire)) return;
@@ -1227,6 +1215,20 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
 
        if (player.nade && (player.offhand != OFFHAND_NADE || (player.weapons & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, player, player.nade_altbutton);
 
+       entity held_nade = player.nade;
+       if (held_nade)
+       {
+               player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1);
+               // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed);
+               makevectors(player.angles);
+               held_nade.velocity = player.velocity;
+               setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0);
+               held_nade.angles_y = player.angles.y;
+
+               if (time + 0.1 >= held_nade.wait)
+                       toss_nade(player, false, '0 0 0', time + 0.05);
+       }
+
        if(IS_PLAYER(player))
        {
                if ( autocvar_g_nades_bonus && autocvar_g_nades )
index d47da6c3c38ed43c3949eed8042f94941d8beef9..21a191a0e67c82b080d962ec034fa668fa997324 100644 (file)
@@ -341,6 +341,12 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
        start_weapons = warmup_start_weapons = ok_start_items;
 }
 
+MUTATOR_HOOKFUNCTION(ok, SetWeaponArena)
+{
+       // turn weapon arena off
+       M_ARGV(0, string) = "off";
+}
+
 MUTATOR_HOOKFUNCTION(ok, BuildMutatorsString)
 {
        M_ARGV(0, string) = strcat(M_ARGV(0, string), ":OK");
index b6dcd01f8843cc5f9310db9b93d213c4848e80ed..dc2e6f7dc0a062a2a19e8c2a611ee12b8cb14ea2 100644 (file)
@@ -89,8 +89,6 @@ void func_breakable_colormod(entity this)
                this.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
        else
                this.colormod = '1 1 1';
-
-       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void func_breakable_look_destroyed(entity this)
@@ -113,8 +111,6 @@ void func_breakable_look_destroyed(entity this)
                this.effects &= ~EF_NODRAW;
        }
 
-       CSQCMODEL_AUTOUPDATE(this);
-
        this.solid = SOLID_NOT;
 }
 
@@ -127,8 +123,6 @@ void func_breakable_look_restore(entity this)
        if(this.mdl_dead != "") // only do this if we use mdl_dead, to behave better with misc_follow
                setorigin(this, this.dropped_origin);
 
-       CSQCMODEL_AUTOUPDATE(this);
-
        this.solid = SOLID_BSP;
 }
 
@@ -148,6 +142,12 @@ void func_breakable_behave_destroyed(entity this)
                stopsound (this, CH_TRIGGER_SINGLE);
 }
 
+void func_breakable_think(entity this)
+{
+       this.nextthink = time;
+       CSQCMODEL_AUTOUPDATE(this);
+}
+
 void func_breakable_destroy(entity this, entity actor, entity trigger);
 void func_breakable_behave_restore(entity this)
 {
@@ -168,7 +168,9 @@ void func_breakable_behave_restore(entity this)
        if(this.spawnflags & 4)
                this.use = func_breakable_destroy; // don't need to set it usually, as .use isn't reset
        this.state = 0;
-       this.nextthink = 0; // cancel auto respawn
+       //this.nextthink = 0; // cancel auto respawn
+       setthink(this, func_breakable_think);
+       this.nextthink = time + 0.1;
        func_breakable_colormod(this);
        if (this.noise1)
                _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
@@ -187,16 +189,12 @@ void func_breakable_destroyed(entity this)
 {
        func_breakable_look_destroyed(this);
        func_breakable_behave_destroyed(this);
-
-       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void func_breakable_restore(entity this, entity actor, entity trigger)
 {
        func_breakable_look_restore(this);
        func_breakable_behave_restore(this);
-
-       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void func_breakable_restore_self(entity this)
@@ -231,6 +229,7 @@ void func_breakable_destroy(entity this, entity actor, entity trigger)
 
        if(this.respawntime)
        {
+               CSQCMODEL_AUTOUPDATE(this);
                setthink(this, func_breakable_restore_self);
                this.nextthink = time + this.respawntime + crandom() * this.respawntimejitter;
        }
@@ -281,6 +280,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float
                // do not explode NOW but in the NEXT FRAME!
                // because recursive calls to RadiusDamage are not allowed
                this.nextthink = time;
+               CSQCMODEL_AUTOUPDATE(this);
                setthink(this, func_breakable_destroy_self);
        }
 }
@@ -293,8 +293,6 @@ void func_breakable_reset(entity this)
                func_breakable_behave_destroyed(this);
        else
                func_breakable_behave_restore(this);
-
-       CSQCMODEL_AUTOUPDATE(this);
 }
 
 // destructible walls that can be used to trigger target_objective_decrease
index d533f19098b7ae6f71efd6ae595f3fd4b6b14635..684ee75d377540a15de2911269dbf6ccf078d982 100644 (file)
@@ -313,7 +313,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
 {
        // loadable hagar secondary attack, must always run each frame
 
-       if(time < game_starttime || PS(actor).m_switchweapon != WEP_HAGAR)
+       if(time < game_starttime)
                return;
 
        bool loaded = actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
index 7f1bce0ace2741c05340c025a1f49524ce4969e1..1f01ef0413c237e262752c59bd5daee816131968 100644 (file)
@@ -396,10 +396,12 @@ METHOD(Tuba, wr_think, void(Tuba this, entity actor, .entity weaponentity, int f
        }
 }
 
+void tuba_instrument_send(entity this, int instr);
 METHOD(Tuba, wr_setup, void(Tuba this, entity actor))
 {
        actor.ammo_field = ammo_none;
        actor.tuba_instrument = 0;
+       tuba_instrument_send(actor, actor.tuba_instrument);
 }
 #endif
 
@@ -412,6 +414,7 @@ NET_HANDLE(tuba_instrument, bool)
        string s = (i == 0) ? "tuba" :
                   (i == 1) ? "akordeon" :
                              "kleinbottle" ;
+    viewmodel.tuba_instrument = i;
        CL_WeaponEntity_SetModel(viewmodel, s, true);
 }
 #endif
@@ -494,13 +497,6 @@ const int TUBA_MIN = -18;
 const int TUBA_MAX = 27;
 const int TUBA_INSTRUMENTS = 3;
 
-entityclass(Tuba);
-class(Tuba) .int note;
-class(Tuba) .bool tuba_attenuate;
-class(Tuba) .float tuba_volume;
-class(Tuba) .float tuba_volume_initial;
-class(Tuba) .int tuba_instrument;
-
 int Tuba_PitchStep;
 
 void tubasound(entity e, bool restart)
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..ce6b6ede739c76fd2dd2eed274912ffce10228a2 100644 (file)
@@ -1 +1,10 @@
 #pragma once
+
+#ifdef CSQC
+entityclass(Tuba);
+class(Tuba) .int note;
+class(Tuba) .bool tuba_attenuate;
+class(Tuba) .float tuba_volume;
+class(Tuba) .float tuba_volume_initial;
+class(Tuba) .int tuba_instrument;
+#endif
index 7b5f23b694ba6991ebf52b1512376d227345188e..187d08068e9342bd5471fb81a3e04a1e1b0f35d6 100644 (file)
@@ -3,7 +3,7 @@
 #include "rootdialog.qh"
 CLASS(XonoticUid2NameDialog, XonoticRootDialog)
        METHOD(XonoticUid2NameDialog, fill, void(entity));
-       ATTRIB(XonoticUid2NameDialog, title, string);
+       ATTRIB(XonoticUid2NameDialog, title, string, "");
        ATTRIB(XonoticUid2NameDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
        ATTRIB(XonoticUid2NameDialog, intendedWidth, float, 0.5);
        ATTRIB(XonoticUid2NameDialog, rows, float, 4);
index 50c766e69051527be55929f7b4524c22ab228f14..e45abfda33b528cce9e9e72035dd4ab1807d47c5 100644 (file)
@@ -154,8 +154,8 @@ int category_draw_count;
        SLIST_CATEGORY(CAT_SERVERS,      "CAT_NORMAL",  "CAT_SERVERS",  CTX(_("SLCAT^Servers"))) \
        SLIST_CATEGORY(CAT_XPM,          "CAT_NORMAL",  "CAT_SERVERS",  CTX(_("SLCAT^Competitive Mode"))) \
        SLIST_CATEGORY(CAT_MODIFIED,     "",            "CAT_SERVERS",  CTX(_("SLCAT^Modified Servers"))) \
-       SLIST_CATEGORY(CAT_OVERKILL,     "",            "CAT_SERVERS",  CTX(_("SLCAT^Overkill Mode"))) \
-       SLIST_CATEGORY(CAT_INSTAGIB,     "",            "CAT_SERVERS",  CTX(_("SLCAT^InstaGib Mode"))) \
+       SLIST_CATEGORY(CAT_OVERKILL,     "",            "CAT_SERVERS",  CTX(_("SLCAT^Overkill"))) \
+       SLIST_CATEGORY(CAT_INSTAGIB,     "",            "CAT_SERVERS",  CTX(_("SLCAT^InstaGib"))) \
        SLIST_CATEGORY(CAT_DEFRAG,       "",            "CAT_SERVERS",  CTX(_("SLCAT^Defrag Mode")))
 
 #define SLIST_CATEGORY_AUTOCVAR(name) autocvar_menu_slist_categories_##name##_override