]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Additional conflict merging
authorz411 <z411@omaera.org>
Thu, 1 Jun 2023 03:32:51 +0000 (23:32 -0400)
committerz411 <z411@omaera.org>
Thu, 1 Jun 2023 03:32:51 +0000 (23:32 -0400)
qcsrc/client/hud/panel/chat.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/common/items/inventory.qh
qcsrc/common/net_linked.qh
qcsrc/server/.world.qh.kate-swp [deleted file]
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/vote.qc
qcsrc/server/items/items.qc
qcsrc/server/world.qh

index 03a63cbbd905911d5d62b161fd4c1c1d723f12e4..d344b33ab369984a58a33a1998e5b4e01655a330 100644 (file)
@@ -3,8 +3,6 @@
 #include <client/draw.qh>
 #include <common/items/inventory.qh>
 
-bool autocvar_hud_panel_itempickup = true; //LegendGuard adds a bool to enable/disable item pickup display HUD 06-04-2021
-bool autocvar_hud_panel_itempickup_timer = true;
 
 // Chat (#12)
 
@@ -161,7 +159,7 @@ void HUD_Chat()
        if (autocvar_con_chat != floor(mySize.y / autocvar_con_chatsize - 0.5))
                cvar_set("con_chat", ftos(floor(mySize.y / autocvar_con_chatsize - 0.5)));
 
-       vector chatsize = '1 1 0' * autocvar_con_chatsize;
+       //vector chatsize = '1 1 0' * autocvar_con_chatsize;
        if(autocvar__hud_configure)
        {
                vector chatsize = '1 1 0' * autocvar_con_chatsize;
@@ -175,43 +173,4 @@ void HUD_Chat()
                        pos.y += chatsize.y;
                }
        }
-       
-       // z411 items
-       if (autocvar_hud_panel_itempickup)
-       {
-               float stat_last_pickup = STAT(LAST_PICKUP);
-               pos.y += mySize.y;
-               entity it = last_pickup_item;
-               
-               if(stat_last_pickup && stat_last_pickup > time - 3 && it) {
-                       float a, y;
-                       string str1, str2, icon;
-                       vector sz, sz2;
-                       vector pickupsize = chatsize * 1.25;
-                       vector iconsize = chatsize * 2;
-                       
-                       icon = strcat(hud_skin_path, "/", ((it.model2) ? it.model2 : it.m_icon));
-                       sz = draw_getimagesize(icon);
-                       sz2 = vec2(iconsize.y*(sz.x/sz.y), iconsize.y);
-                       str2 = ((last_pickup_times > 1) ? sprintf("%s (x%d)", it.m_name, last_pickup_times) : it.m_name);
-                       y = (iconsize.y - pickupsize.y) / 2;
-                       
-                       if(time < stat_last_pickup + 3 - 0.5)
-                               a = 1;
-                       else
-                               a = (stat_last_pickup + 3 - time) / 0.5;
-                       
-                       if(autocvar_hud_panel_itempickup_timer) {
-                               if(spectatee_status || !(serverflags & SERVERFLAG_FORBID_PICKUPTIMER)) {
-                                       str1 = seconds_tostring(last_pickup_timer);
-                                       drawstring(pos + eY * y, str1, pickupsize, '1 1 1', a, DRAWFLAG_NORMAL);
-                                       pos.x += stringwidth(str1, false, pickupsize) + pickupsize.x * 0.25;
-                               }
-                       }
-                       
-                       drawpic(pos, icon, sz2, '1 1 1', a, DRAWFLAG_NORMAL);
-                       pos.x += sz2.x + pickupsize.x * 0.25;
-                       drawstring(pos + eY * y, str2, pickupsize, '1 1 1', a, DRAWFLAG_NORMAL);
-               }
-       }
 }
index bca88712daf93cae2b243ce9ac521b824309a708..329601a0c0d424f17d45709fdfa8eb526cdabce4 100644 (file)
@@ -1041,6 +1041,21 @@ vector autocvar_hud_panel_scoreboard_ping_worst_color = '1 0 0';
 #define COLOR_MED autocvar_hud_panel_scoreboard_ping_medium_color
 #define COLOR_HIGH autocvar_hud_panel_scoreboard_ping_high_color
 #define COLOR_WORST autocvar_hud_panel_scoreboard_ping_worst_color
+
+vector getPingColor(float f)
+{
+       if(f < PING_BEST)
+               return COLOR_BEST;
+       else if(f < PING_MED)
+               return COLOR_BEST + (COLOR_MED - COLOR_BEST) * ((f - PING_BEST) / (PING_MED - PING_BEST));
+       else if(f < PING_HIGH)
+               return COLOR_MED + (COLOR_HIGH - COLOR_MED) * ((f - PING_MED) / (PING_HIGH - PING_MED));
+       else if(f < PING_WORST)
+               return COLOR_HIGH + (COLOR_WORST - COLOR_HIGH) * ((f - PING_HIGH) / (PING_WORST - PING_HIGH));
+       else
+               return COLOR_WORST;
+}
+
 string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round)
 {
        float tmp, num, denom;
@@ -1066,16 +1081,7 @@ string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round)
                        f = pl.ping;
                        if(f == 0)
                                return _("N/A");
-                       if(f < PING_BEST)
-                               sbt_field_rgb = COLOR_BEST;
-                       else if(f < PING_MED)
-                               sbt_field_rgb = COLOR_BEST + (COLOR_MED - COLOR_BEST) * ((f - PING_BEST) / (PING_MED - PING_BEST));
-                       else if(f < PING_HIGH)
-                               sbt_field_rgb = COLOR_MED + (COLOR_HIGH - COLOR_MED) * ((f - PING_MED) / (PING_HIGH - PING_MED));
-                       else if(f < PING_WORST)
-                               sbt_field_rgb = COLOR_HIGH + (COLOR_WORST - COLOR_HIGH) * ((f - PING_HIGH) / (PING_WORST - PING_HIGH));
-                       else
-                               sbt_field_rgb = COLOR_WORST;
+                       sbt_field_rgb = getPingColor(f);
                        return ftos(f);
 
                case SP_PL:
@@ -1502,7 +1508,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
                
                string flag_name = "";
                vector flag_size = '0 0 0';
-               Scoreboard_GetField(pl, SP_COUNTRY);
+               Scoreboard_GetField(pl, SP_COUNTRY, autocvar_hud_panel_scoreboard_scores_per_round);
                
                if(sbt_field_icon3 != "") {
                        sz = draw_getimagesize(sbt_field_icon3);
@@ -1721,7 +1727,7 @@ void Scoreboard_Duel_DrawTable(vector pos, bool invert, entity pl, entity tm)
        
        //LegendGuard adds a conditional sentence for country column 05-04-2021
        // Player country icon/flag
-       Scoreboard_GetField(pl, SP_COUNTRY);
+       Scoreboard_GetField(pl, SP_COUNTRY, autocvar_hud_panel_scoreboard_scores_per_round);
        if(sbt_field_icon3 != "") {
                vector rsz = draw_getimagesize(sbt_field_icon3);
                sbt_fixcolumnwidth_iconlen = rsz.x / rsz.y;
@@ -1776,11 +1782,11 @@ void Scoreboard_Duel_DrawTable(vector pos, bool invert, entity pl, entity tm)
        else
                i++;
        
-       tmp_str = Scoreboard_GetField(pl, SP_PING);
+       tmp_str = Scoreboard_GetField(pl, SP_PING, autocvar_hud_panel_scoreboard_scores_per_round);
        drawstring(tmp + eX * column_width * i + (eX * column_width / 2) - eX * (stringwidth(tmp_str, false, hud_fontsize * 1.25) / 2),
                tmp_str, hud_fontsize * 1.25, sbt_field_rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
 
-       tmp_str = Scoreboard_GetField(pl, SP_PL);
+       tmp_str = Scoreboard_GetField(pl, SP_PL, autocvar_hud_panel_scoreboard_scores_per_round);
        drawstring(tmp + eX * column_width * (invert ? i-- : i++) + (eX * column_width / 2) - eX * (stringwidth(tmp_str, false, hud_fontsize * 0.75) / 2) + eY * (hud_fontsize.y * 1.25),
                tmp_str, hud_fontsize * 0.75, sbt_field_rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
 
index c5ba1f5266a103dc3bc39412db5823982db7dfc0..ef724ebcf5a71657c5b197a7935bcf2695688991 100644 (file)
@@ -85,7 +85,6 @@ void HUD_Timer()
        if(!intermission_time && !warmup_stage && timelimit > 0)
                timer_color = HUD_Timer_Color(timeleft);
 
-<<<<<<< HEAD
        // countdown sound
        // if 3 use server dictated option, otherwise the client's
        int countdown_type;
index c17f9391abd77ebcae72ebdbdd601edfad957015..94e09e67b7595ebc230b3082dc8dc605d8913ef7 100644 (file)
@@ -64,8 +64,8 @@ void Inventory_handle(entity inv, bool mine)
             }
             const GameItem it = REGISTRY_GET(Items, Inventory_groups_minor * i + j);
             .int fld = inv_items[it.m_id];
-            int prev = this.(fld);
-            int next = this.(fld) = ReadByte();
+            int prev = inv.(fld);
+            int next = inv.(fld) = ReadByte();
 
             Pickup_Update(it, next - prev);
             LOG_DEBUGF("%s: %.0f -> %.0f", it.m_name, prev, next);
index 79cd6c4fe8bce13852fe633a25ab1a742f2427d6..1413981c6938abc71ba1f6bfa999608456ba1575 100644 (file)
@@ -11,7 +11,6 @@ REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
 
 REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES)
 REGISTER_NET_TEMP(TE_CSQC_CHATSOUND)
-REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
 REGISTER_NET_TEMP(TE_CSQC_TOTALSHARDS) // for RJZ
 
 const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
diff --git a/qcsrc/server/.world.qh.kate-swp b/qcsrc/server/.world.qh.kate-swp
deleted file mode 100644 (file)
index f6ef71e..0000000
Binary files a/qcsrc/server/.world.qh.kate-swp and /dev/null differ
index 32a10884ec2a93a587f583c499025ddc3a4e0b07..a619d9a077bf2d87bd48617e0effbe2ea2a61cff 100644 (file)
@@ -552,17 +552,34 @@ void FixPlayermodel(entity player)
                                setcolor(player, stof(autocvar_sv_defaultplayercolors));
 }
 
-void GiveWarmupResources(entity this)
-{
-       SetResource(this, RES_SHELLS, warmup_start_ammo_shells);
-       SetResource(this, RES_BULLETS, warmup_start_ammo_nails);
-       SetResource(this, RES_ROCKETS, warmup_start_ammo_rockets);
-       SetResource(this, RES_CELLS, warmup_start_ammo_cells);
-       SetResource(this, RES_PLASMA, warmup_start_ammo_plasma);
-       SetResource(this, RES_FUEL, warmup_start_ammo_fuel);
-       SetResource(this, RES_HEALTH, warmup_start_health);
-       SetResource(this, RES_ARMOR, warmup_start_armorvalue);
-       STAT(WEAPONS, this) = WARMUP_START_WEAPONS;
+void ResetPlayerResources(entity this)
+{
+       if (warmup_stage) {
+               SetResource(this, RES_SHELLS, warmup_start_ammo_shells);
+               SetResource(this, RES_BULLETS, warmup_start_ammo_nails);
+               SetResource(this, RES_ROCKETS, warmup_start_ammo_rockets);
+               SetResource(this, RES_CELLS, warmup_start_ammo_cells);
+               SetResource(this, RES_PLASMA, warmup_start_ammo_plasma);
+               SetResource(this, RES_FUEL, warmup_start_ammo_fuel);
+               SetResource(this, RES_HEALTH, warmup_start_health);
+               SetResource(this, RES_ARMOR, warmup_start_armorvalue);
+               STAT(WEAPONS, this) = WARMUP_START_WEAPONS;
+       } else {
+               SetResource(this, RES_SHELLS, start_ammo_shells);
+               SetResource(this, RES_BULLETS, start_ammo_nails);
+               SetResource(this, RES_ROCKETS, start_ammo_rockets);
+               SetResource(this, RES_CELLS, start_ammo_cells);
+               SetResource(this, RES_PLASMA, start_ammo_plasma);
+               SetResource(this, RES_FUEL, start_ammo_fuel);
+               SetResource(this, RES_HEALTH, start_health);
+               SetResource(this, RES_ARMOR, start_armorvalue);
+               STAT(WEAPONS, this) = start_weapons;
+               if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
+               {
+                       GiveRandomWeapons(this, random_start_weapons_count,
+                               autocvar_g_random_start_weapons, random_start_ammo);
+               }
+       }
 }
 
 void PutPlayerInServer(entity this)
@@ -607,25 +624,8 @@ void PutPlayerInServer(entity this)
        this.takedamage = DAMAGE_AIM;
        this.effects = EF_TELEPORT_BIT | EF_RESTARTANIM_BIT;
 
-       if (warmup_stage)
-               GiveWarmupResources(this);
-       else
-       {
-               SetResource(this, RES_SHELLS, start_ammo_shells);
-               SetResource(this, RES_BULLETS, start_ammo_nails);
-               SetResource(this, RES_ROCKETS, start_ammo_rockets);
-               SetResource(this, RES_CELLS, start_ammo_cells);
-               SetResource(this, RES_PLASMA, start_ammo_plasma);
-               SetResource(this, RES_FUEL, start_ammo_fuel);
-               SetResource(this, RES_HEALTH, start_health);
-               SetResource(this, RES_ARMOR, start_armorvalue);
-               STAT(WEAPONS, this) = start_weapons;
-               if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
-               {
-                       GiveRandomWeapons(this, random_start_weapons_count,
-                               autocvar_g_random_start_weapons, random_start_ammo);
-               }
-       }
+       ResetPlayerResources(this);
+
        SetSpectatee_status(this, 0);
 
        PS(this).dual_weapons = '0 0 0';
index a8259c3fbe4ac057fa69bb6ea9eb9791b24236f4..957656acdb92d06b9ec9ba2365cfdb867d88a1b9 100644 (file)
@@ -419,7 +419,7 @@ void SetSpectatee_status(entity this, int spectatee_num);
 
 void FixPlayermodel(entity player);
 
-void GiveWarmupResources(entity this);
+void ResetPlayerResources(entity this);
 
 void ClientInit_misc(entity this);
 
index f1ff5093170c591f9f713d11131e324193261f56..cc7f6240f9368c23b9978efb42cab3bf3c795c03 100644 (file)
@@ -560,7 +560,7 @@ void ReadyCount()
                        game_starttime = time;
                        Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, COUNTDOWN_STOP, minplayers);
                        if (!sv_ready_restart_after_countdown) // if we ran reset_map() at start of countdown
-                               FOREACH_CLIENT(IS_PLAYER(it), { GiveWarmupResources(it); });
+                               FOREACH_CLIENT(IS_PLAYER(it), { ResetPlayerResources(it); });
                }
                if (warmup_limit > 0)
                        warmup_limit = -1;
index 0ae811024009b3ca0cf7722926019e4fbb83b0bf..eec5f8a27dbb3a4c2be53206b309bada0f9ee319 100644 (file)
@@ -548,30 +548,18 @@ bool Item_GiveTo(entity item, entity player)
                {
                        pickedup = true;
                        FOREACH(Weapons, it != WEP_Null, {
-<<<<<<< HEAD
-                               Weapon wep = it;
-                               
-                               if(w & (wep.m_wepset)) {
-                                       // z411 Seriously find a better way to do this
-                                       Item_NotifyWeapon(player, wep.m_id);
-                                       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == player, { Item_NotifyWeapon(it, wep.m_id); });
-                               }
-                               
-                               if(wp & (wep.m_wepset))
-=======
                                if(w & (it.m_wepset))
                                        Item_NotifyWeapon(player, it.m_id);
 
                                if(wp & (it.m_wepset))
->>>>>>> master
                                {
                                        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                                        {
                                                .entity weaponentity = weaponentities[slot];
                                                if(player.(weaponentity).m_weapon != WEP_Null || slot == 0)
-                                                       W_DropEvent(wr_pickup, player, wep.m_id, item, weaponentity);
+                                                       W_DropEvent(wr_pickup, player, it.m_id, item, weaponentity);
                                        }
-                                       W_GiveWeapon(player, wep.m_id);
+                                       W_GiveWeapon(player, it.m_id);
                                }
                        });
                }
index 1631d18b717405420b095d76241bca376c051c40..0951848e7c529422e5d0293431b03f1668af67d3 100644 (file)
@@ -31,7 +31,6 @@ float autocvar_timelimit_suddendeath;
 bool autocvar_sv_gameplayfix_droptofloorstartsolid;
 bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect;
 
-<<<<<<< HEAD
 // z411
 bool autocvar_sv_jingle_end;
 string autocvar_sv_jingle_end_list;
@@ -39,10 +38,8 @@ float autocvar_sv_jingle_end_volume;
 
 float fragsleft;
 int fragsleft_last;
-=======
 bool autocvar_sv_mapformat_is_quake3;
 bool autocvar_sv_mapformat_is_quake2;
->>>>>>> master
 
 float checkrules_equality;
 float checkrules_suddendeathwarning;