From: z411 Date: Thu, 15 Apr 2021 01:58:33 +0000 (-0400) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=becc801608c0832f5c4725859033dee0ff19332a;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- becc801608c0832f5c4725859033dee0ff19332a diff --cc qcsrc/client/announcer.qc index e5c18a559,a5b3eecb1..301185a92 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@@ -2,13 -2,8 +2,12 @@@ #include #include - #include #include +#include + +#include +#include bool announcer_1min; bool announcer_5min; diff --cc qcsrc/client/hud/panel/centerprint.qc index 16b0b0e0d,105908094..f9802ba81 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@@ -43,41 -43,6 +43,44 @@@ float centerprint_expire_time[CENTERPRI int centerprint_countdown_num[CENTERPRINT_MAX_MSGS]; bool centerprint_showing; ++<<<<<<< HEAD +float centerprint_medal_expire_time; +string centerprint_medal_icon; +float centerprint_medal_times; + +bool centerprint_title_show; +string centerprint_title; + +void centerprint_ClearTitle() +{ + centerprint_title_show = false; +} +void centerprint_SetTitle(string title) +{ + if(title != centerprint_title) { + if(centerprint_title) + strunzone(centerprint_title); + centerprint_title = strzone(title); + + centerprint_title_show = true; + } +} + +void centerprint_Medal(string icon, float times) +{ + //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times); + //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time; + centerprint_medal_expire_time = time + MSG_MEDAL_TIME; + centerprint_medal_times = times; + if(centerprint_medal_icon) + strunzone(centerprint_medal_icon); + centerprint_medal_icon = strzone(strcat("gfx/medal/", icon)); + + 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); @@@ -357,10 -275,10 +361,17 @@@ 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 --cc qcsrc/client/hud/panel/chat.qc index 33f8b6a13,972848260..c126259b1 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@@ -75,15 -74,23 +75,23 @@@ void HUD_Chat( if (!autocvar_con_chatrect) cvar_set("con_chatrect", "1"); - cvar_set("con_chatrect_x", ftos(pos.x/vid_conwidth)); - cvar_set("con_chatrect_y", ftos(pos.y/vid_conheight)); - - cvar_set("con_chatwidth", ftos(mySize.x/vid_conwidth)); - cvar_set("con_chat", ftos(floor(mySize.y/autocvar_con_chatsize - 0.5))); + // can't use a name ending with _x, _y and _z for a float autocvar as for autocvar specs + // it prevents ambiguity with component names of vector autocvars + if (cvar_string("con_chatrect_x") != ftos(pos.x / vid_conwidth)) + cvar_set("con_chatrect_x", ftos(pos.x / vid_conwidth)); + if (cvar_string("con_chatrect_y") != ftos(pos.y / vid_conheight)) + cvar_set("con_chatrect_y", ftos(pos.y / vid_conheight)); + // can't use direct comparison here, it would always returns true even if + // both arguments are equal because con_chatwidth is saved with cvar_set + //if (autocvar_con_chatwidth != mySize.x / vid_conwidth) + if (fabs(autocvar_con_chatwidth - mySize.x / vid_conwidth) > 0.00001) + cvar_set("con_chatwidth", ftos(mySize.x / vid_conwidth)); + 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; if(autocvar__hud_configure) { - vector chatsize = '1 1 0' * autocvar_con_chatsize; cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors); for(int i = 0; i < autocvar_con_chat; ++i) diff --cc qcsrc/client/hud/panel/scoreboard.qc index 0b788fdb1,24b6efe6c..e6d718f1a --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -105,8 -103,6 +111,7 @@@ float autocvar_hud_panel_scoreboard_min bool autocvar_hud_panel_scoreboard_playerid = false; string autocvar_hud_panel_scoreboard_playerid_prefix = "#"; string autocvar_hud_panel_scoreboard_playerid_suffix = " "; - +int average_ping[NUM_TEAMS]; // mode 0: returns translated label // mode 1: prints name and description of all the labels @@@ -2271,10 -1997,10 +2433,12 @@@ void Scoreboard_Draw( pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size); } + pos = Scoreboard_MedalStats_Draw(pos); + if (Scoreboard_AccuracyStats_WouldDraw(pos.y)) pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size); + if (Scoreboard_ItemStats_WouldDraw(pos.y)) + pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size); if(MUTATOR_CALLHOOK(ShowRankings)) { string ranktitle = M_ARGV(0, string); diff --cc qcsrc/client/shownames.qc index af4d766ec,27157a5a1..23e4f7a20 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@@ -141,60 -154,67 +154,122 @@@ 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) // limit resize so its never smaller than 0.5... gets unreadable + 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 } - // draw the sprite image - if (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); + mySize.x *= resize; + mySize.y *= resize; + myPos.x += 0.5 * (mySize.x / resize - mySize.x); + myPos.y += (mySize.y / resize - mySize.y); + + this.box_org = myPos + mySize / 2; + this.box_ofs = mySize / 2; + + 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); + + this.box_ofs.x = max(mySize.x / 2, sz.x); // sz.x is already half as wide + this.box_ofs.y += sz.y / 2; + this.box_org.y = myPos.y + (mySize.y + sz.y) / 2; + // antioverlap debug code + //drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, DRAWFLAG_NORMAL); + + 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); + } ++>>>>>>> master } + // antioverlap debug code + //else drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, 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'; } void Draw_ShowNames_All() diff --cc qcsrc/common/command/generic.qc index e354a9a59,929d37653..566b1cfee --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@@ -303,10 -303,10 +303,17 @@@ void GenericCommand_maplist(int request 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; } } @@@ -325,8 -325,8 +332,13 @@@ void GenericCommand_nextframe(int reque 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; } } @@@ -502,7 -502,7 +514,11 @@@ void GenericCommand_runtest(int request default: case CMD_REQUEST_USAGE: { ++<<<<<<< HEAD + LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]"); ++======= + LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " "); ++>>>>>>> master return; } } diff --cc qcsrc/common/ent_cs.qc index fb0981150,a3691386b..fbce8a70e --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@@ -161,19 -157,25 +161,30 @@@ ENTCS_PROP(SOLID, true, sv_solid, solid { WriteByte(chan, ent.sv_solid); }, { ent.sv_solid = ReadByte(); }) +// z411 weapon +ENTCS_PROP(ACTIVEWEPID, false, activewepid, activewepid, ENTCS_SET_NORMAL, + { WriteByte(chan, ent.activewepid); }, + { ent.activewepid = ReadByte(); }) + #ifdef SVQC - int ENTCS_PUBLICMASK = 0; + int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0; STATIC_INIT(ENTCS_PUBLICMASK) { - FOREACH(EntCSProps, it.m_public, + FOREACH(EntCSProps, true, { - ENTCS_PUBLICMASK |= BIT(it.m_id); + if (it.m_public) + ENTCS_PUBLICMASK |= BIT(it.m_id); + else + ENTCS_PRIVATEMASK |= BIT(it.m_id); + }); + } + + void entcs_update_players(entity player) + { + FOREACH_CLIENT(it != player && IS_PLAYER(it), + { + CS(it).entcs.SendFlags |= ENTCS_PRIVATEMASK; }); } diff --cc qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc index 7c83260d0,458465faa..039827e79 --- a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc @@@ -292,42 -263,8 +263,47 @@@ MUTATOR_HOOKFUNCTION(cts, GetPressedKey { 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 --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 5eb256320,54fac9a5a..abddb3030 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@@ -625,14 -606,20 +645,21 @@@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink nades_GiveBonus(it, autocvar_g_nades_bonus_score_low); } - entity first = reviving_players_first; - Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname); - Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname); - Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, first.netname); + 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); + if(autocvar_sv_eventlog) + { + string revivers = ""; + for(entity it = revivers_first; it; it = it.chain) + revivers = strcat(revivers, ftos(it.playerid), ","); + revivers = substring(revivers, 0, strlen(revivers) - 1); + GameLogEcho(strcat(":ft:revival:", ftos(player.playerid), ":", revivers)); + } } - for(entity it = reviving_players_first; it; it = it.chain) + for(entity it = revivers_first; it; it = it.chain) STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player); } diff --cc qcsrc/common/gamemodes/gamemode/race/sv_race.qc index c87384c94,ecfd36605..fa741ccab --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@@ -142,14 -136,7 +136,7 @@@ MUTATOR_HOOKFUNCTION(rc, PlayerPhysics player.race_movetime_frac -= f; player.race_movetime_count += f; player.race_movetime = player.race_movetime_frac + player.race_movetime_count; - } - - MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) - { - entity player = M_ARGV(0, entity); - //float dt = M_ARGV(1, float); -- - #ifdef SVQC ++ if(IS_PLAYER(player)) { if (player.race_penalty) diff --cc qcsrc/common/items/inventory.qh index c0a94707b,abc367d51..49341c9cc --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@@ -37,21 -37,18 +37,29 @@@ STATIC_INIT(Inventory #endif #ifdef CSQC -Inventory g_inventory; +#include + +//Inventory g_inventory; +Inventory inventoryslots[255]; +float last_pickup_timer; +entity last_pickup_item; +int last_pickup_times; ++ + void Inventory_remove(entity this) + { + if(g_inventory == this) + g_inventory = NULL; + } + NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew) { make_pure(this); - g_inventory = this; + //g_inventory = this; + this.entremove = Inventory_remove; + + float entnum = ReadByte() - 1; + inventoryslots[entnum] = this; - ++ const int majorBits = Readbits(Inventory_groups_major); for (int i = 0; i < Inventory_groups_major; ++i) { if (!(majorBits & BIT(i))) { @@@ -147,10 -124,6 +155,10 @@@ bool Inventory_Send(Inventory this, Cli TC(Inventory, this); WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY); TC(PlayerState, this.owner); - ++ + // z411 send entity number + WriteByte(MSG_ENTITY, etof(this.owner.m_client)); + Inventory_Write(this, to.inventory_store); return true; } @@@ -164,22 -137,22 +172,22 @@@ bool Inventory_customize(entity this, e void Inventory_new(PlayerState this) { Inventory inv = NEW(Inventory); - setcefc(inv, Inventory_customize); + if(!g_duel) setcefc(inv, Inventory_customize); Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send); } - void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); } + 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_delete(entity e) { delete(e.inventory_store); } +void InventoryStorage_detach(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); + }); +} #endif diff --cc qcsrc/common/mutators/mutator/overkill/oknex.qc index a4e55983f,aefc72346..80ccdd7d8 --- a/qcsrc/common/mutators/mutator/overkill/oknex.qc +++ b/qcsrc/common/mutators/mutator/overkill/oknex.qc @@@ -94,20 -94,18 +94,20 @@@ void W_OverkillNex_Attack(Weapon thiswe } yoda = 0; - damage_goodhits = 0; + impressive_hits = 0; FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id); - if(yoda && flying) - Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); + if(yoda && flying) { + Give_Medal(actor, YODA); + } + - if(damage_goodhits && actor.oknex_lasthit) + if(impressive_hits && actor.oknex_lasthit) { - Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); + Give_Medal(actor, IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.oknex_lasthit = damage_goodhits; + actor.oknex_lasthit = impressive_hits; //beam and muzzle flash done on client SendCSQCVortexBeamParticle(charge); diff --cc qcsrc/common/notifications/all.qh index d08089143,5a7b0af0f..0b1bf6063 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@@ -163,16 -158,11 +163,18 @@@ void Create_Notification_Entity_Choice( Notification optiona, Notification optionb); +void Create_Notification_Entity_Medal(entity notif, + float var_cvar, + string namestring, + /* MSG_MEDAL */ + string icon, + Notification anncename); + void Dump_Notifications(int fh, bool alsoprint); - GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt", false) + #define DEFAULT_FILENAME "notifications_dump.cfg" + // NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code + GENERIC_COMMAND(dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, false) { switch (request) { @@@ -210,8 -200,8 +212,13 @@@ 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; @@@ -830,14 -743,14 +838,21 @@@ Notification Get_Notif_Ent(MSG net_type 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) + MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime) -#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position) \ +#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \ REGISTER(Notifications, name, m_id, new_pure(msg_annce_notification)) { \ Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_ANNCE, strtoupper(#name), teamnum); \ Create_Notification_Entity_Annce(this, ACVNN(cvarname), strtoupper(#name), \ diff --cc qcsrc/common/replicate.qh index ad79d2cc7,f9cb040fa..7c10cce32 --- a/qcsrc/common/replicate.qh +++ b/qcsrc/common/replicate.qh @@@ -8,9 -8,8 +8,9 @@@ bool cvar_cl_allow_uidranking; float cvar_cl_autoscreenshot; float cvar_cl_autotaunt; - float cvar_cl_clippedspectating; + bool cvar_cl_clippedspectating; int cvar_cl_gunalign; + bool cvar_cl_chat_sounds; float cvar_cl_handicap; float cvar_cl_jetpack_jump; float cvar_cl_movement_track_canjump; @@@ -29,8 -28,7 +29,8 @@@ #elif defined(SVQC) .float cvar_cl_handicap; .int cvar_cl_gunalign; + .bool cvar_cl_chat_sounds; - .float cvar_cl_clippedspectating; + .bool cvar_cl_clippedspectating; .float cvar_cl_autoscreenshot; .float cvar_cl_jetpack_jump; .float cvar_cl_movement_track_canjump; diff --cc qcsrc/common/turrets/all.qh index e44c5d9b5,5bebc285d..578b3521d --- a/qcsrc/common/turrets/all.qh +++ b/qcsrc/common/turrets/all.qh @@@ -100,8 -102,8 +102,13 @@@ GENERIC_COMMAND(dumpturrets, "Dump all 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 --cc qcsrc/common/weapons/all.qh index 479c0b6b3,24057a0b8..c926d24c7 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@@ -82,8 -84,8 +84,13 @@@ GENERIC_COMMAND(dumpweapons, "Dump all 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 --cc qcsrc/common/weapons/weapon/electro.qc index 310d69599,9409819e9..9e7213057 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@@ -79,13 -74,12 +74,14 @@@ void W_Electro_Explode(entity this, ent if(IS_PLAYER(directhitentity)) if(DIFF_TEAM(this.realowner, directhitentity)) if(!IS_DEAD(directhitentity)) - if(IsFlying(directhitentity)) - Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH); - + if(IsFlying(directhitentity)) { + Give_Medal(this.realowner, ELECTROBITCH); + } + */ + this.event_damage = func_null; this.takedamage = DAMAGE_NO; + this.velocity = this.movedir; // particle fx and decals need .velocity if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway? { diff --cc qcsrc/common/weapons/weapon/vaporizer.qc index a7b0533ee,6f4d4aebf..f884b14d1 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@@ -129,19 -129,17 +129,18 @@@ void W_Vaporizer_Attack(Weapon thiswep // do this now, as goodhits is disabled below vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg)); - SendCSQCVaporizerBeamParticle(actor, damage_goodhits); + SendCSQCVaporizerBeamParticle(actor, impressive_hits); - if(yoda && flying) { - Give_Medal(actor, YODA); - } - - if(damage_goodhits && actor.vaporizer_lasthit) + if(yoda && flying) + Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); + if(impressive_hits && actor.vaporizer_lasthit) { + Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); + Give_Medal(actor, IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.vaporizer_lasthit = damage_goodhits; + actor.vaporizer_lasthit = impressive_hits; if(autocvar_g_rm) if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))) diff --cc qcsrc/common/weapons/weapon/vortex.qc index e78a1be08,7372fe8e1..876eaac03 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@@ -138,20 -138,18 +138,20 @@@ void W_Vortex_Attack(Weapon thiswep, en } yoda = 0; - damage_goodhits = 0; + impressive_hits = 0; FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype); - if(yoda && flying) - Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); + if(yoda && flying) { + Give_Medal(actor, YODA); + } + - if(damage_goodhits && actor.vortex_lasthit) + if(impressive_hits && actor.vortex_lasthit) { - Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); + Give_Medal(actor, IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.vortex_lasthit = damage_goodhits; + actor.vortex_lasthit = impressive_hits; //beam done on client vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); @@@ -182,7 -180,7 +182,11 @@@ METHOD(Vortex, wr_aim, void(entity this 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 --cc qcsrc/menu/xonotic/credits.qc index 86f0f6d98,4b50e591e..344eb7590 --- a/qcsrc/menu/xonotic/credits.qc +++ b/qcsrc/menu/xonotic/credits.qc @@@ -13,24 -11,14 +11,14 @@@ PERSON(Zac "Mario" Jardine) \ NL() \ TITLE(_("Extended Team")) \ - PERSON(AllieWay) \ PERSON(Antonio "terencehill" Piu) \ - PERSON(Archer) \ - PERSON(BuddyFriendGuy) \ + PERSON(bones_was_here) \ PERSON(David "Cloudwalk" Knapp) \ - PERSON(Debugger) \ - PERSON(Diomedes) \ PERSON(Freddy) \ - PERSON(GATTS) \ PERSON(Halogene) \ PERSON(Jan "zykure" Behrens) \ - PERSON(JH0nny) \ - PERSON(Łukasz "kuniu the frogg" Polek) \ - PERSON(martin-t) \ - PERSON(Matthias "matthiaskrgr" Krüger) \ - PERSON(Mattia "Melanosuchus" Basaglia) \ - PERSON(Morosophos) \ ++// PERSON(Morosophos) \ PERSON(MrBougo) \ - PERSON(Nick "bitbomb" Lucca) \ PERSON(nilyt/nyov) \ PERSON(Nitroxis) \ PERSON(packer) \ diff --cc qcsrc/server/client.qc index 7f6682ef3,4cabc4697..288193e6e --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@@ -840,10 -829,8 +845,10 @@@ void PutClientInServer(entity this } else if (IS_PLAYER(this)) { PutPlayerInServer(this); } - - + // send team names + if(teamplay && IS_REAL_CLIENT(this)) + send_TeamNames(MSG_ONE, this); + bot_relinkplayerlist(); } // TODO do we need all these fields, or should we stop autodetecting runtime diff --cc qcsrc/server/client.qh index 943b65ed1,43e041bf6..bf9dbf9ec --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@@ -414,8 -404,3 +415,9 @@@ void Join(entity this) #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); } const int MAX_SPECTATORS = 7; + +float _medal_times; +#define Give_Medal(entity,medalname) \ + _medal_times = GameRules_scoring_add(entity, MEDAL_##medalname, 1); \ + Send_Notification(NOTIF_ONE, entity, MSG_MEDAL, MEDAL_##medalname, _medal_times); ++ diff --cc qcsrc/server/round_handler.qc index ef6466747,93c383527..d8163cd0e --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@@ -96,9 -93,9 +96,9 @@@ void round_handler_Spawn(bool() canRoun backtrace("Can't spawn round_handler again!"); return; } - entity this = round_handler = new(round_handler); + entity this = round_handler = new_pure(round_handler); - setthink(this, round_handler_FirstThink); + this.canRoundStart = canRoundStart_func; this.canRoundEnd = canRoundEnd_func; this.roundStart = roundStart_func; diff --cc qcsrc/server/weapons/accuracy.qc index e940555e3,2fe010f64..4482fc9fd --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@@ -84,21 -65,7 +84,21 @@@ void accuracy_resend(entity e //.float hit_time; .float fired_time; +void roundaccuracy_clear(entity this) +{ + if (IS_INDEPENDENT_PLAYER(this)) return; + entity ra = this.roundaccuracy; + + for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w) { + ra.accuracy_frags[w] = 0; + ra.accuracy_hit[w] = 0; + ra.accuracy_fired[w] = 0; + ra.accuracy_cnt_hit[w] = 0; + ra.accuracy_cnt_fired[w] = 0; + } +} + - void accuracy_add(entity this, Weapon w, int fired, int hit) + void accuracy_add(entity this, Weapon w, float fired, float hit) { if (IS_INDEPENDENT_PLAYER(this)) return; entity a = CS(this).accuracy; diff --cc qcsrc/server/world.qh index a43c8dac1,bdaac8c27..f965438d1 --- a/qcsrc/server/world.qh +++ b/qcsrc/server/world.qh @@@ -48,8 -45,7 +50,9 @@@ string modname string gamemode_name; +int fragsleft; +int fragsleft_last; + string record_type; string clientstuff;