]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Final conflict merge
authorz411 <z411@omaera.org>
Thu, 15 Apr 2021 16:06:34 +0000 (12:06 -0400)
committerz411 <z411@omaera.org>
Thu, 15 Apr 2021 16:06:34 +0000 (12:06 -0400)
15 files changed:
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/common/command/generic.qc
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/items/inventory.qh
qcsrc/common/notifications/all.qh
qcsrc/common/state.qc
qcsrc/common/turrets/all.qh
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/menu/xonotic/credits.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc

index f9802ba813946bdacebf7804ee12cf1493c6cd9e..5dd7cd828fd78bb4f40b29b02f25d8a73e2b41c4 100644 (file)
@@ -43,7 +43,6 @@ float centerprint_expire_time[CENTERPRINT_MAX_MSGS];
 int centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
 bool centerprint_showing;
 
-<<<<<<< HEAD
 float centerprint_medal_expire_time;
 string centerprint_medal_icon;
 float centerprint_medal_times;
@@ -79,8 +78,6 @@ void centerprint_Medal(string icon, float times)
        centerprint_showing = true;
 }
 
-=======
->>>>>>> master
 void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num)
 {
        TC(int, new_id); TC(int, countdown_num);
@@ -361,17 +358,10 @@ void HUD_CenterPrint()
                all_messages_expired = false;
 
                // fade
-<<<<<<< HEAD
                //if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
                //      a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
                if(centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)  // Regularily printed. Not fading out yet.
                        a = 1;
-=======
-               if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
-                       a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
-               else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)  // Regularily printed. Not fading out yet.
-                       a = (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
->>>>>>> master
                else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
 
index e6d718f1af32baf35d0ce6a981fe8dcd8fac87fa..25fcae0fafe256821148357bf1d03f6cc7f7454a 100644 (file)
@@ -1742,6 +1742,7 @@ STATIC_INIT(default_order_items_label)
 
 vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
 {
+       Inventory g_inventory = inventoryslots[current_player];
        scoreboard_itemstats_fade_alpha = min(scoreboard_fade_alpha, scoreboard_itemstats_fade_alpha + frametime * 10);
 
        int disowned_cnt = 0;
@@ -2064,6 +2065,8 @@ bool Scoreboard_AccuracyStats_WouldDraw(float ypos)
 bool have_item_stats;
 bool Scoreboard_ItemStats_WouldDraw(float ypos)
 {
+       Inventory g_inventory = inventoryslots[current_player];
+       
        if (MUTATOR_CALLHOOK(DrawScoreboardItemStats))
                return false;
        if (!autocvar_hud_panel_scoreboard_itemstats || !g_inventory || warmup_stage || ypos > 0.91 * vid_conheight)
index 23e4f7a208baac35752cf9681e137d916ec94320..27157a5a165fa1c9dc904cf2e0e36e4aec1c9893 100644 (file)
@@ -154,31 +154,17 @@ void Draw_ShowNames(entity this)
        }
        else if (vdist(this.origin - view_origin, >=, max_shot_distance))
                return;
-<<<<<<< HEAD
-       if (!a) return;
-=======
        if (!a || o.z < 0) return;
 
        o.z = 0;
->>>>>>> master
        float resize = 1;
        if (autocvar_hud_shownames_resize && vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
        {
-<<<<<<< HEAD
-               if (vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
-               {
-                       float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
-                       if (dist == -1)
-                               dist = vlen(this.origin - view_origin);
-                       resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
-               }
-=======
                // limit resize so its never smaller than 0.5... gets unreadable
                float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
                if (dist == -1)
                        dist = vlen(this.origin - view_origin);
                resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
->>>>>>> master
        }
        vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
        vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
@@ -193,46 +179,6 @@ void Draw_ShowNames(entity this)
        float namewidth = mySize.x;
        if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
        {
-<<<<<<< HEAD
-               o.z = 0;
-               vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
-               vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
-               // size scaling
-               mySize.x *= resize;
-               mySize.y *= resize;
-               myPos.x += 0.5 * (mySize.x / resize - mySize.x);
-               myPos.y += (mySize.y / resize - mySize.y);
-               // this is where the origin of the string
-               float namewidth = mySize.x;
-               if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
-               {
-                       vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
-                       vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
-                       if (autocvar_hud_shownames_statusbar_highlight)
-                               drawfill(pos + eX * 0.25 * mySize.x, sz, '0.7 0.7 0.7', a / 2, DRAWFLAG_NORMAL);
-                       if (this.healthvalue > 0)
-                       {
-                               HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar",
-                                       this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a,
-                                       DRAWFLAG_NORMAL);
-                       }
-                       if (GetResource(this, RES_ARMOR) > 0)
-                       {
-                               HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar",
-                                       GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
-                                       DRAWFLAG_NORMAL);
-                       }
-               }
-               string s = entcs_GetName(this.sv_entnum - 1);
-               if ((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
-                       s = playername(s, entcs_GetTeam(this.sv_entnum - 1), true);
-               drawfontscale = '1 1 0' * resize;
-               s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
-               float width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize);
-               myPos.x = o.x - (width * resize) / 2;
-               drawcolorcodedstring(myPos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
-               drawfontscale = '1 1 0';
-=======
                vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
                vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
 
@@ -256,7 +202,6 @@ void Draw_ShowNames(entity this)
                                GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
                                DRAWFLAG_NORMAL);
                }
->>>>>>> master
        }
        // antioverlap debug code
        //else drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, DRAWFLAG_NORMAL);
index 566b1cfeea2ce214c1bb6f57574487ac06323790..929d3765345084e1e85917705e498417e46563c0 100644 (file)
@@ -303,17 +303,10 @@ void GenericCommand_maplist(int request, int argc)
                        LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
                case CMD_REQUEST_USAGE:
                {
-<<<<<<< HEAD
-                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]");
-                       LOG_HELP("  Where 'action' is the command to complete,");
-                       LOG_HELP("  and 'map' is what it acts upon (if required).");
-                       LOG_HELP("  Full list of commands here: \"add, cleanup, remove, shuffle.\"");
-=======
                        LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist <action> [<map>]");
                        LOG_HELP("  Where <action> is the command to complete,");
                        LOG_HELP("  and <map> is what it acts upon (for the 'add' and 'remove' actions).");
                        LOG_HELP("  Full list of commands here: add, cleanup, remove, shuffle.");
->>>>>>> master
                        return;
                }
        }
@@ -332,13 +325,8 @@ void GenericCommand_nextframe(int request, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-<<<<<<< HEAD
-                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...");
-                       LOG_HELP("  Where command will be executed next frame of this VM");
-=======
                        LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe <command>");
                        LOG_HELP("  Where <command> will be executed next frame of this VM");
->>>>>>> master
                        return;
                }
        }
@@ -514,11 +502,7 @@ void GenericCommand_runtest(int request, int argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-<<<<<<< HEAD
-                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
-=======
                        LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " <function>");
->>>>>>> master
                        return;
                }
        }
index 039827e79848dec0424f30c27493e0dbbb535fb8..458465faaa260587a60563407fa72630d228c21e 100644 (file)
@@ -263,47 +263,8 @@ MUTATOR_HOOKFUNCTION(cts, GetPressedKeys)
 {
        entity player = M_ARGV(0, entity);
 
-<<<<<<< HEAD
-       if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
-       {
-               if (!player.stored_netname)
-                       player.stored_netname = strzone(uid2name(player.crypto_idfp));
-               if(player.stored_netname != player.netname)
-               {
-                       db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
-                       strcpy(player.stored_netname, player.netname);
-               }
-       }
-
-       if (!IS_OBSERVER(player))
-       {
-               if(vdist(player.velocity - player.velocity_z * '0 0 1', >, speedaward_speed))
-               {
-                       speedaward_speed = vlen(player.velocity - player.velocity_z * '0 0 1');
-                       speedaward_holder = player.netname;
-                       speedaward_uid = player.crypto_idfp;
-                       speedaward_lastupdate = time;
-               }
-               if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
-               {
-                       string rr = CTS_RECORD;
-                       race_send_speedaward(MSG_ALL);
-                       speedaward_lastsent = speedaward_speed;
-                       if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
-                       {
-                               speedaward_alltimebest = speedaward_speed;
-                               speedaward_alltimebest_holder = speedaward_holder;
-                               speedaward_alltimebest_uid = speedaward_uid;
-                               db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
-                               db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
-                               race_send_speedaward_alltimebest(MSG_ALL);
-                       }
-               }
-       }
-=======
        race_checkAndWriteName(player);
        race_SpeedAwardFrame(player);
->>>>>>> master
 }
 
 MUTATOR_HOOKFUNCTION(cts, ForbidThrowCurrentWeapon)
index abddb303052777ef03f24f551989a461c80e5899..460a1c300e35bc1a6ecdc51f8f674f6583e2a160 100644 (file)
@@ -648,7 +648,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
                        Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
-                       Give_Medal(first, ASSIST);
+                       Give_Medal(revivers_first, ASSIST);
                        if(autocvar_sv_eventlog)
                        {
                                string revivers = "";
index 49341c9ccbf6157276bbaa8c4497a7836a954181..814896874b0309c6c743d00ec8a52f439c7ba226 100644 (file)
@@ -47,15 +47,16 @@ int last_pickup_times;
 
 void Inventory_remove(entity this)
 {
-    if(g_inventory == this)
-        g_inventory = NULL;
+    // TODO z411
+    //if(g_inventory == this)
+    //    g_inventory = NULL;
 }
 
 NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
 {
     make_pure(this);
     //g_inventory = this;
-    this.entremove = Inventory_remove;
+    //this.entremove = Inventory_remove;
        
        float entnum = ReadByte() - 1;
        inventoryslots[entnum] = this;
@@ -178,16 +179,28 @@ void Inventory_new(PlayerState this)
 void Inventory_delete(entity e) { delete(e.inventory); }
 void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
 
+void Inventory_clear(entity store)
+{
+    // NOTE: you will need to perform Inventory_update after this to update the storage entity
+    // (unless store is the storage entity)
+    FOREACH(Items, true, {
+        .int fld = inv_items[it.m_id];
+        store.(fld) = 0;
+    });
+}
+
 void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; }
-void InventoryStorage_detach(entity e) { delete(e.inventory_store); }
+void InventoryStorage_delete(entity e) { delete(e.inventory_store); }
 
 void Inventory_ClearAll() {
-       FOREACH_CLIENT(IS_PLAYER(it), {
-               entity store = PS(it);          
-               FOREACH(Items, true, {
-                       store.inventory.inv_items[it.m_id] = 0;
-               });
-        Inventory_update(store);
+       FOREACH_CLIENT(IS_PLAYER(it),
+       {
+               entity store = PS(it);
+               if (store)
+               {
+                       Inventory_clear(store.inventory);
+                       Inventory_update(store);
+               }
        });
 }
 #endif
index 0b1bf60633983394d4de2b689c052b08a5acb008..e35609896c54c7a852b6babd73f992e8f3db82d7 100644 (file)
@@ -212,13 +212,8 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, fal
                default:
                case CMD_REQUEST_USAGE:
                {
-<<<<<<< HEAD
-                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
-                       LOG_HELP("  Where 'filename' is the file to write (default is notifications_dump.cfg),");
-=======
                        LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [<filename>]");
                        LOG_HELPF("  Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
                        LOG_HELP("  if supplied with '-' output to console as well as default,");
                        LOG_HELP("  if left blank, it will only write to default.");
                        return;
@@ -838,17 +833,10 @@ Notification Get_Notif_Ent(MSG net_type, int net_name)
        return it;
 }
 
-<<<<<<< HEAD
 #define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
        MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position, queuetime)
 
 #define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position, queuetime) \
-=======
-#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position) \
-       MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position)
-
-#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position) \
->>>>>>> master
        NOTIF_ADD_AUTOCVAR(ANNCE_##name, defaultvalue) \
        MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime)
 
index 018f626e0318bcf02dee8807f08260afd1262158..a42185eb5634c13a15aebd84ae4b20c3e6088182 100644 (file)
@@ -5,6 +5,7 @@
 void Inventory_new(PlayerState this);
 void Inventory_delete(entity this);
 void Inventory_clear(PlayerState this);
+//void Inventory_ClearAll();
 void InventoryStorage_attach(PlayerState this);
 void InventoryStorage_delete(PlayerState this);
 
@@ -23,7 +24,7 @@ void PlayerState_detach(entity this)
     PlayerState ps = PS(this);
        if (!ps) return;  // initial connect
        PS(this) = NULL;
-    Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
+    //Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
 
        if (ps.m_client != this) return;  // don't own state, spectator
        ps.ps_push(ps, this);
index 578b3521d638498113f5a004a727e19ddb6521b4..5bebc285db77fbcdc8c9fc5c75686601a3911ac0 100644 (file)
@@ -102,13 +102,8 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into " DEFAULT_FILENAME, false)
         default:
         case CMD_REQUEST_USAGE:
         {
-<<<<<<< HEAD
-            LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
-            LOG_HELP("  Where 'filename' is the file to write (default is turrets_dump.cfg),");
-=======
             LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [<filename>]");
             LOG_HELPF("  Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
             LOG_HELP("  if supplied with '-' output to console as well as default,");
             LOG_HELP("  if left blank, it will only write to default.");
             return;
index c926d24c7dcb5a07b529392d2e9109f2786519aa..24057a0b8348209686ba56c3242df57f1889576e 100644 (file)
@@ -84,13 +84,8 @@ GENERIC_COMMAND(dumpweapons, "Dump all turrets into " DEFAULT_FILENAME, false) /
         default:
         case CMD_REQUEST_USAGE:
         {
-<<<<<<< HEAD
-            LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]");
-            LOG_HELP("  Where 'filename' is the file to write (default is weapons_dump.cfg),");
-=======
             LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [<filename>]");
             LOG_HELPF("  Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
             LOG_HELP("  if supplied with '-' output to console as well as default,");
             LOG_HELP("  if left blank, it will only write to default.");
             return;
index 876eaac03a25885d020f87ba460e94933ecaaa9c..32026c9efee3ee444e5d232acce5b41cb30a7a26 100644 (file)
@@ -182,11 +182,7 @@ METHOD(Vortex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     if(!WEP_CVAR(vortex, charge_always))
-<<<<<<< HEAD
-        W_Vortex_Charge(actor, weaponentity, frametime);
-=======
         W_Vortex_Charge(actor, weaponentity, frametime / W_TICSPERFRAME);
->>>>>>> master
 
     if(WEP_CVAR_SEC(vortex, chargepool))
         if(actor.(weaponentity).vortex_chargepool_ammo < 1)
index 344eb7590420543cc3c35a1ac5e5dc1c2d6d2ef8..4b50e591ebd4e5d5fd3c485e425ec19f0b2466a3 100644 (file)
@@ -17,7 +17,7 @@
                PERSON(Freddy) \
                PERSON(Halogene) \
                PERSON(Jan "zykure" Behrens) \
-//             PERSON(Morosophos) \
+               PERSON(Morosophos) \
                PERSON(MrBougo) \
                PERSON(nilyt/nyov) \
                PERSON(Nitroxis) \
index f1c8a44e45382bdc5dd3769bba3464637962dd9b..0f9b94c3e28d97254e2d5fc0908ee4d4fbd6a0f2 100644 (file)
@@ -1710,7 +1710,6 @@ void GameCommand_(int request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 SERVER_COMMAND(setflag, "Set client flag") { GameCommand_setflag(request, arguments); }
 SERVER_COMMAND(teamname, "Set team name") { GameCommand_teamname(request, arguments); }
-SERVER_COMMAND(stop, "Stop") { GameCommand_stop(request, arguments); }
 
 SERVER_COMMAND(adminmsg, "Send an admin message to a client directly") { GameCommand_adminmsg(request, arguments); }
 SERVER_COMMAND(allready, "Restart the server and reset the players") { GameCommand_allready(request); }
index d57600e5795baa6189b53c79516d88b0105898a2..3c01e87c7e05d53a003f3b3216b1da98f29b1ee7 100644 (file)
@@ -503,7 +503,7 @@ void ReadyRestart()
        // Otherwise scores could be manipulated during the countdown.
        if (!sv_ready_restart_after_countdown) {
                Score_ClearAll();
-               Inventory_ClearAll();
+               //Inventory_ClearAll();
        }
        ReadyRestart_force();
 }