Merge branch 'master' into terencehill/LMS_improvements 394/head
authorterencehill <piuntn@gmail.com>
Sun, 27 Nov 2016 23:23:32 +0000 (00:23 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 27 Nov 2016 23:23:32 +0000 (00:23 +0100)
.gitlab-ci.yml
_hud_common.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/constants.qh
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/physics/player.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/ecs/lib.qh

index 3c4126b..70b0200 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=93decd0a82cf911f02fb5572197db7f3
+    - EXPECT=04d63df6a5d73bd335612543efd944d6
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index c7befdd..2e8d64d 100644 (file)
@@ -108,7 +108,7 @@ seta hud_panel_infomessages_group_time 6 "number of seconds a message of a group
 seta hud_panel_infomessages_group_fadetime 0.4 "group message fade in/out time"
 
 seta hud_panel_scoreboard_namesize 15 "size limit of player names and relative column (multiplied by fontsize)"
-seta hud_panel_scoreboard_maxheight 0.5 "max height of the scoreboard; a few players that wouldn't fit into the scoreboard are listed in the last row"
+seta hud_panel_scoreboard_maxheight 0.6 "max height of the scoreboard; a few players that wouldn't fit into the scoreboard are listed in the last row"
 seta hud_panel_scoreboard_others_showscore 1 "show scores of players listed in the last row when the scoreboard reaches the max height"
 seta hud_panel_scoreboard_spectators_showping 1 "show ping of spectators"
 seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns"
index 9e1f4cb..57b632b 100644 (file)
@@ -456,7 +456,7 @@ set g_balance_vaporizer_switchdelay_raise 0.2
 set g_balance_vaporizer_weaponreplace ""
 set g_balance_vaporizer_weaponstart 0
 set g_balance_vaporizer_weaponstartoverride -1
-set g_balance_vaporizer_weaponthrowable 0
+set g_balance_vaporizer_weaponthrowable 1
 // }}}
 // {{{ #13: Grappling Hook
 set g_balance_hook_primary_ammo 5
index 9e1f4cb..57b632b 100644 (file)
@@ -456,7 +456,7 @@ set g_balance_vaporizer_switchdelay_raise 0.2
 set g_balance_vaporizer_weaponreplace ""
 set g_balance_vaporizer_weaponstart 0
 set g_balance_vaporizer_weaponstartoverride -1
-set g_balance_vaporizer_weaponthrowable 0
+set g_balance_vaporizer_weaponthrowable 1
 // }}}
 // {{{ #13: Grappling Hook
 set g_balance_hook_primary_ammo 5
index 934fe71..35de219 100644 (file)
@@ -59,7 +59,7 @@ bool autocvar_hud_panel_scoreboard_accuracy_nocolors = false;
 
 bool autocvar_hud_panel_scoreboard_dynamichud = false;
 
-float autocvar_hud_panel_scoreboard_maxheight = 0.5;
+float autocvar_hud_panel_scoreboard_maxheight = 0.6;
 bool autocvar_hud_panel_scoreboard_others_showscore = true;
 bool autocvar_hud_panel_scoreboard_spectators_showping = true;
 bool autocvar_hud_panel_scoreboard_spectators_aligned = false;
@@ -670,7 +670,7 @@ string Scoreboard_GetField(entity pl, PlayerScoreField field)
                case SP_DMG: case SP_DMGTAKEN:
                        return sprintf("%.1f k", pl.(scores(field)) / 1000);
 
-               default:
+               default: case SP_SCORE:
                        tmp = pl.(scores(field));
                        f = scores_flags(field);
                        if(field == ps_primary)
@@ -951,7 +951,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
                                field = Scoreboard_GetField(pl, SP_PING);
                }
                else if(autocvar_hud_panel_scoreboard_others_showscore)
-                       field = ftos(pl.(scores(ps_primary)));
+                       field = Scoreboard_GetField(pl, SP_SCORE);
 
                string str = textShortenToWidth(entcs_GetName(pl.sv_entnum), namesize, hud_fontsize, stringwidth_colors);
                float column_width = stringwidth(str, true, hud_fontsize);
@@ -1009,10 +1009,16 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
        int max_players = 999;
        if(autocvar_hud_panel_scoreboard_maxheight > 0)
        {
-               max_players = autocvar_hud_panel_scoreboard_maxheight * vid_conheight;
+               float height = autocvar_hud_panel_scoreboard_maxheight * vid_conheight;
                if(teamplay)
-                       max_players = (max_players - hud_fontsize.y * 1.25 - panel_bg_padding * 2) / 2;
-               max_players = floor(max_players / (hud_fontsize.y * 1.25));
+               {
+                       height -= (panel_bg_padding * 2 + hud_fontsize.y * 1.25) * team_count; // - padding and header
+                       height -= hud_fontsize.y * (team_count - 1); // - spacing between tables
+                       height /= team_count;
+               }
+               else
+                       height -= panel_bg_padding * 2; // - padding
+               max_players = floor(height / (hud_fontsize.y * 1.25));
                if(max_players <= 1)
                        max_players = 1;
                if(max_players == tm.team_size)
index 14a02b4..910f34e 100644 (file)
@@ -233,7 +233,7 @@ const int SPECIES_RESERVED = 15;
 const int FRAGS_PLAYER = 0;
 const int FRAGS_SPECTATOR = -666;
 const int FRAGS_LMS_LOSER = -616;
-const int FRAGS_PLAYER_NONSOLID = -616;
+const int FRAGS_PLAYER_NONSOLID = FRAGS_LMS_LOSER;
 // we can use this frags value for both
 
 // water levels
index 6ec9c23..c09e221 100644 (file)
@@ -153,12 +153,14 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 REGISTER_MUTATOR(nades, cvar("g_nades"));
 
 .float nade_time_primed;
+.float nade_lifetime;
 
 .entity nade_spawnloc;
 
+
 void nade_timer_think(entity this)
 {
-       this.skin = 8 - (this.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10);
+       this.skin = 8 - (this.owner.wait - time) / (this.owner.nade_lifetime / 10);
        this.nextthink = time;
        if(!this.owner || wasfreed(this.owner))
                delete(this);
@@ -862,7 +864,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
        if(this.health == this.max_health)
        {
                sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
-               this.nextthink = max(time + autocvar_g_nades_nade_lifetime, time);
+               this.nextthink = max(time + this.nade_lifetime, time);
                setthink(this, nade_beep);
        }
 
@@ -1048,6 +1050,7 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
        setthink(n, nade_beep);
        n.nextthink = max(n.wait - 3, time);
        n.projectiledeathtype = DEATH_NADE.m_id;
+       n.nade_lifetime = ntime;
 
        setmodel(fn, MDL_NADE_VIEW);
        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
@@ -1218,7 +1221,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
        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);
+               player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / held_nade.nade_lifetime, 1);
                // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed);
                makevectors(player.angles);
                held_nade.velocity = player.velocity;
index e7a3356..a26441e 100644 (file)
@@ -475,13 +475,13 @@ void Draw_WaypointSprite(entity this)
 
     InterpolateOrigin_Do(this);
 
-    float t = entcs_GetTeam(player_localnum) + 1;
     string spriteimage = "";
 
     // choose the sprite
     switch (this.rule)
     {
         case SPRITERULE_SPECTATOR:
+            float t = entcs_GetTeam(player_localnum) + 1;
             if (!(
                 (autocvar_g_waypointsprite_itemstime == 1 && t == NUM_SPECTATOR + 1)
             || (autocvar_g_waypointsprite_itemstime == 2 && (t == NUM_SPECTATOR + 1 || warmup_stage || STAT(ITEMSTIME) == 2))
@@ -492,7 +492,7 @@ void Draw_WaypointSprite(entity this)
         case SPRITERULE_DEFAULT:
             if (this.team)
             {
-                if (this.team == t)
+                if (this.team == myteam + 1)
                     spriteimage = this.netname;
                 else
                     spriteimage = "";
@@ -501,9 +501,9 @@ void Draw_WaypointSprite(entity this)
                 spriteimage = this.netname;
             break;
         case SPRITERULE_TEAMPLAY:
-            if (t == NUM_SPECTATOR + 1)
+            if (myteam == NUM_SPECTATOR)
                 spriteimage = this.netname3;
-            else if (this.team == t)
+            else if (this.team == myteam + 1)
                 spriteimage = this.netname2;
             else
                 spriteimage = this.netname;
@@ -613,7 +613,7 @@ void Draw_WaypointSprite(entity this)
 
     float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) );
 
-    t = waypointsprite_scale;
+    float t = waypointsprite_scale;
     a *= waypointsprite_alpha;
 
     {
index b5635e0..2645415 100644 (file)
@@ -481,15 +481,15 @@ float racecar_angle(float forward, float down)
                return ret * angle_mult;
 }
 
+#ifdef SVQC
 string specialcommand = "xwxwxsxsxaxdxaxdx1x ";
 .float specialcommand_pos;
 void SpecialCommand(entity this)
 {
-#ifdef SVQC
        if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
                LOG_INFO("A hollow voice says \"Plugh\".\n");
-#endif
 }
+#endif
 
 bool PM_check_specialcommand(entity this, int buttons)
 {
index c21e327..48c6a87 100644 (file)
@@ -67,13 +67,12 @@ void turret_draw2d(entity this)
                return;
 
        float dist = vlen(this.origin - view_origin);
-       float t = (entcs_GetTeam(player_localnum) + 1);
 
        vector o;
        string txt;
 
        if(autocvar_cl_vehicles_hud_tactical)
-       if(dist < 10240 && t != this.team)
+       if(dist < 10240 && (myteam + 1 != this.team))
        {
                // TODO: Vehicle tactical hud
                o = project_3d_to_2d(this.origin + '0 0 32');
@@ -121,7 +120,7 @@ void turret_draw2d(entity this)
        else
                txt = spritelookuptext(this, spriteimage);
 
-       if(time - floor(time) > 0.5 && t == this.team)
+       if(time - floor(time) > 0.5 && (myteam + 1 == this.team))
        {
                if(this.helpme && time < this.helpme)
                {
@@ -163,7 +162,7 @@ void turret_draw2d(entity this)
 
        float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) );
 
-       t = waypointsprite_scale;
+       float t = waypointsprite_scale;
        a *= waypointsprite_alpha;
 
        {
index a617c73..2d48e57 100644 (file)
@@ -28,8 +28,8 @@
  */
 #define SYSTEM(sys, frameLimit, minfps) \
        void sys_##sys##_update(entity this, float dt); \
-       float autocvar_xon_sys_##sys##_dt = ((frameLimit) ? (1 / (frameLimit)) : 0); \
-       float autocvar_xon_sys_##sys##_minfps = (1 / (1 / (minfps)))
+       noref float autocvar_xon_sys_##sys##_dt = ((frameLimit) ? (1 / (frameLimit)) : 0); \
+       noref float autocvar_xon_sys_##sys##_minfps = (1 / (1 / (minfps)))
 
 #define SYSTEM_UPDATE(sys) \
        MACRO_BEGIN \