From 2980faf78aa053921f324e516c54d96e5fe0c234 Mon Sep 17 00:00:00 2001 From: z411 Date: Thu, 15 Apr 2021 12:06:34 -0400 Subject: [PATCH] Final conflict merge --- qcsrc/client/hud/panel/centerprint.qc | 10 ---- qcsrc/client/hud/panel/scoreboard.qc | 3 + qcsrc/client/shownames.qc | 55 ------------------- qcsrc/common/command/generic.qc | 16 ------ qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc | 39 ------------- .../gamemode/freezetag/sv_freezetag.qc | 2 +- qcsrc/common/items/inventory.qh | 33 +++++++---- qcsrc/common/notifications/all.qh | 12 ---- qcsrc/common/state.qc | 3 +- qcsrc/common/turrets/all.qh | 5 -- qcsrc/common/weapons/all.qh | 5 -- qcsrc/common/weapons/weapon/vortex.qc | 4 -- qcsrc/menu/xonotic/credits.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 1 - qcsrc/server/command/vote.qc | 2 +- 15 files changed, 31 insertions(+), 161 deletions(-) diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index f9802ba81..5dd7cd828 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -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); diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index e6d718f1a..25fcae0fa 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 23e4f7a20..27157a5a1 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -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); diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 566b1cfee..929d37653 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -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 []"); LOG_HELP(" Where is the command to complete,"); LOG_HELP(" and 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 "); LOG_HELP(" Where 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(), " "); ->>>>>>> master return; } } diff --git a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc index 039827e79..458465faa 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc @@ -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) diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index abddb3030..460a1c300 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -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 = ""; diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index 49341c9cc..814896874 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -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 diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 0b1bf6063..e35609896 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -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 []"); LOG_HELPF(" Where 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) diff --git a/qcsrc/common/state.qc b/qcsrc/common/state.qc index 018f626e0..a42185eb5 100644 --- a/qcsrc/common/state.qc +++ b/qcsrc/common/state.qc @@ -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); diff --git a/qcsrc/common/turrets/all.qh b/qcsrc/common/turrets/all.qh index 578b3521d..5bebc285d 100644 --- a/qcsrc/common/turrets/all.qh +++ b/qcsrc/common/turrets/all.qh @@ -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 []"); LOG_HELPF(" Where 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; diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index c926d24c7..24057a0b8 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -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 []"); LOG_HELPF(" Where 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; diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 876eaac03..32026c9ef 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -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) diff --git a/qcsrc/menu/xonotic/credits.qc b/qcsrc/menu/xonotic/credits.qc index 344eb7590..4b50e591e 100644 --- a/qcsrc/menu/xonotic/credits.qc +++ b/qcsrc/menu/xonotic/credits.qc @@ -17,7 +17,7 @@ PERSON(Freddy) \ PERSON(Halogene) \ PERSON(Jan "zykure" Behrens) \ -// PERSON(Morosophos) \ + PERSON(Morosophos) \ PERSON(MrBougo) \ PERSON(nilyt/nyov) \ PERSON(Nitroxis) \ diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index f1c8a44e4..0f9b94c3e 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -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); } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index d57600e57..3c01e87c7 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -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(); } -- 2.39.2