]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'bones_was_here/BoxTouchesBrush' into 'master'
authorterencehill <piuntn@gmail.com>
Fri, 19 May 2023 15:20:39 +0000 (15:20 +0000)
committerterencehill <piuntn@gmail.com>
Fri, 19 May 2023 15:20:39 +0000 (15:20 +0000)
WarpZoneLib_BoxTouchesBrush() fixes

See merge request xonotic/xonotic-data.pk3dir!1142

13 files changed:
_hud_common.cfg
mutators.cfg
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/mapvoting.qc
qcsrc/common/mapinfo.qc
qcsrc/dpdefs/upstream/csprogsdefs.qc
qcsrc/dpdefs/upstream/dpextensions.qc
qcsrc/dpdefs/upstream/menudefs.qc
qcsrc/dpdefs/upstream/progsdefs.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/mapvoting.qc
qcsrc/server/mapvoting.qh
xonotic-client.cfg

index da4be22b3ae1107a4dee71eecf1186327bcc840f..95f1e9758b0f10c48e20d3100e3adc23673e1172 100644 (file)
@@ -143,6 +143,14 @@ seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns"
 seta hud_panel_scoreboard_spectators_position 1 "spectator list position (0 = before accuracy and itemstats, 1 = before rankings, 2 = after rankings, 3 = after map stats)"
 seta hud_panel_scoreboard_minwidth 0.6 "minimum width of the scoreboard"
 seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary"
+seta hud_panel_scoreboard_ping_best 0 "use best_color for this ping"
+seta hud_panel_scoreboard_ping_medium 70 "use medium_color for this ping"
+seta hud_panel_scoreboard_ping_high 100 "use high_color for this ping"
+seta hud_panel_scoreboard_ping_worst 150 "use worst_color for this ping"
+seta hud_panel_scoreboard_ping_best_color "0 1 0" "color for best ping"
+seta hud_panel_scoreboard_ping_medium_color "1 1 0" "color for medium ping"
+seta hud_panel_scoreboard_ping_high_color "1 0.5 0" "color for high ping"
+seta hud_panel_scoreboard_ping_worst_color "1 0 0" "color for worst ping"
 seta hud_panel_scoreboard_playerid 0 "show player id (server entity number) next to player's name"
 seta hud_panel_scoreboard_playerid_prefix "#" "player id prefix"
 seta hud_panel_scoreboard_playerid_suffix " " "player id suffix"
index 66fe9214205907c7797e291b814f56a19fe65d3b..24dc379ddcf37e65a0cbf51f31d81fd30014fc3b 100644 (file)
@@ -42,8 +42,8 @@ set g_instagib_ammo_convert_bullets 0 "convert bullet ammo packs to insta cell a
 set g_instagib_ammo_convert_cells 0 "convert normal cell ammo packs to insta cell ammo packs"
 set g_instagib_ammo_convert_rockets 0 "convert rocket ammo packs to insta cell ammo packs"
 set g_instagib_ammo_convert_shells 0 "convert shell ammo packs to insta cell ammo packs"
-set g_instagib_invisibility_time 30 "Time of invisibility powerup in seconds."
-set g_instagib_speed_time 30 "Time of speed powerup in seconds."
+set g_instagib_invisibility_time 30 "time of invisibility powerup in seconds"
+set g_instagib_speed_time 30 "time of speed powerup in seconds"
 set g_instagib_damagedbycontents 1 "allow damage from lava pits in instagib"
 set g_instagib_blaster_keepdamage 0 "allow secondary fire to hurt players"
 set g_instagib_blaster_keepforce 0 "allow secondary fire to push players"
index 566f5a695635fe93419460c58ba81ec955162345..8d6fcee5633a2a877deab46c192be9fe461fd9f8 100644 (file)
@@ -982,6 +982,22 @@ string Scoreboard_GetName(entity pl)
        return entcs_GetName(pl.sv_entnum);
 }
 
+int autocvar_hud_panel_scoreboard_ping_best = 0;
+int autocvar_hud_panel_scoreboard_ping_medium = 70;
+int autocvar_hud_panel_scoreboard_ping_high = 100;
+int autocvar_hud_panel_scoreboard_ping_worst = 150;
+vector autocvar_hud_panel_scoreboard_ping_best_color = '0 1 0';
+vector autocvar_hud_panel_scoreboard_ping_medium_color = '1 1 0';
+vector autocvar_hud_panel_scoreboard_ping_high_color = '1 0.5 0';
+vector autocvar_hud_panel_scoreboard_ping_worst_color = '1 0 0';
+#define PING_BEST autocvar_hud_panel_scoreboard_ping_best
+#define PING_MED autocvar_hud_panel_scoreboard_ping_medium
+#define PING_HIGH autocvar_hud_panel_scoreboard_ping_high
+#define PING_WORST autocvar_hud_panel_scoreboard_ping_worst
+#define COLOR_BEST autocvar_hud_panel_scoreboard_ping_best_color
+#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
 string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round)
 {
        float tmp, num, denom;
@@ -1006,8 +1022,16 @@ string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round)
                        f = pl.ping;
                        if(f == 0)
                                return _("N/A");
-                       tmp = max(0, min(220, f-80)) / 220;
-                       sbt_field_rgb = '1 1 1' - '0 1 1' * tmp;
+                       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;
                        return ftos(f);
 
                case SP_PL:
index e2aea3055ce0cd19fa5e686f0c6422160015f910..9e6f6395b26750d003b8bf744a72ccf45332ec0c 100644 (file)
@@ -39,7 +39,7 @@ int mv_columns;
 int mv_mouse_selection;
 int mv_selection_keyboard;
 
-float gametypevote;
+bool gametypevote;
 string mapvote_chosenmap;
 vector gtv_text_size;
 vector gtv_text_size_small;
@@ -732,14 +732,10 @@ void MapVote_Init()
        mv_ownvote = -1;
        mv_timeout = ReadCoord();
 
-       gametypevote = ReadByte();
-
-       if(gametypevote)
-       {
+       int gametypevote_flags = ReadByte();
+       gametypevote = boolean(gametypevote_flags & BIT(0));
+       if(gametypevote_flags)
                mapvote_chosenmap = strzone(ReadString());
-               if ( gametypevote == 2 )
-                       gametypevote = 0;
-       }
 
        MapVote_ReadMask();
        int i;
index c2b15729578d9353e82cd822b7005db7ebd4da1e..82a7e758413de31ffd73eae094b93717c67fb678 100644 (file)
@@ -935,9 +935,6 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety
        return false;
 }
 
-#if defined(CSQC) || defined(MENUQC)
-string(string filename) whichpack = #503;
-#endif
 string _MapInfo_CheckArenaFile(string pFilename, string pMapname)
 {
        // returns the file name if valid, otherwise returns ""
index 457bd7cd80706508cb007507dc151a27d323b64a..f607125b4ca0bac4404bfd6011e2078ab1cccedd 100644 (file)
@@ -435,6 +435,7 @@ string(string s, float start, float length) substring = #116;
 vector(string) stov = #117;
 string(string s) strzone = #118;
 void(string s) strunzone = #119;
+void(string s, float chan, float vol) localsound = #177;
 
 // FTEQW range #200-#299
 
@@ -1182,6 +1183,16 @@ float CVAR_TYPEFLAG_READONLY = 32;
 //When caseinsensitive is set, the CRC is calculated of the lower cased string.
 float(float caseinsensitive, string s, ...) crc16 = #494;
 
+//DP_QC_WHICHPACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string filename) whichpack = #503;
+//description:
+//for files in a pak/pk3/whatever, returns the pack's file name in FRIK_FILE name space.
+//for physical files, returns "".
+//in case of error, returns string_null.
+
 //DP_QC_URI_ESCAPE
 //idea: divVerent
 //darkplaces implementation: divVerent
@@ -1474,3 +1485,5 @@ vector gettaginfo_forward;
 vector gettaginfo_right;
 vector gettaginfo_up;
 float checkpvs(vector viewpos, entity viewee) = #240;
+// bones_was_here: commented as QC wants to use this but we still need to support div0-stable:
+//float mod(float dividend, float divisor) = #245;
index 1aeecfafd62f242f84e857b4da6950ce94d04773..57e1006021b12e9472eeaf5911f7095657e53cb1 100644 (file)
@@ -763,10 +763,10 @@ entity(.string fld, string match) findchain = #402;
 //idea: divVerent
 //darkplaces implementation: divVerent
 //builtin definitions:
-entity(.string fld, float match, .entity tofield) findradius_tofield = #22;
+entity(vector org, float rad, .entity tofield) findradius_tofield = #22;
 entity(.string fld, string match, .entity tofield) findchain_tofield = #402;
-entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450;
-entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403;
+entity(.float fld, float match, .entity tofield) findchainflags_tofield = #450;
+entity(.float fld, float match, .entity tofield) findchainfloat_tofield = #403;
 //description:
 //similar to findchain() etc, but stores the chain into .tofield instead of .chain
 //actually, the .entity tofield is an optional field of the the existing findchain* functions
@@ -2632,3 +2632,27 @@ float(string pattern, float caseinsensitive, float quiet, string packfile) searc
 //description:
 //extension to search_begin (DP_QC_FS_SEARCH), performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
 //only searches for files within the specified packfile, which is expected to match the results of whichpack().
+
+//EXT_CSQC (registercommand for CSQC, now also available in SVQC)
+//idea: probably Spoike
+//darkplaces implementation: Cloudwalk
+//builtin definitions:
+void(string cmdname) registercommand = #352;
+//engine-called QC prototypes:
+//float CSQC_ConsoleCommand(string command);
+//float ConsoleCmd(string command);
+//description:
+//Adds a new console command which will take priority over a previous command of the same name (including engine commands) and in CSQC is removed when the VM shuts down. This will call CSQC_ConsoleCommand(string command) or ConsoleCmd(string command) in SVQC.  Return value should be true if QC handled the command, otherwise return false to have the engine handle it.
+
+
+//DP_QC_FINDBOX
+//idea: Mario
+//darkplaces implementation: bones_was_here
+//builtin definitions:
+entity(vector mins, vector maxs) findbox = #566;
+entity(vector mins, vector maxs, .entity tofield) findbox_tofield = #566;
+//description:
+//Returns a chain of entities that are touching a box (a simpler findradius); supports DP_QC_FINDCHAIN_TOFIELD
+
+// bones_was_here: commented as QC wants to use this but we still need to support div0-stable:
+//float(float dividend, float divisor) mod = #245;
index 63d2c6388e8447e90e46445abbe65506e93e074b..7282f4cdbbe4e59a609a4ecfe7fc42a37af330e4 100644 (file)
@@ -477,6 +477,16 @@ string(string digest, string data, ...) digest_hex = #639;
 //if the given digest is not supported, string_null is returned
 //the digest string is matched case sensitively, use "MD4", not "md4"!
 
+//DP_QC_WHICHPACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string filename) whichpack = #503;
+//description:
+//for files in a pak/pk3/whatever, returns the pack's file name in FRIK_FILE name space.
+//for physical files, returns "".
+//in case of error, returns string_null.
+
 //DP_QC_URI_ESCAPE
 //idea: div0
 //darkplaces implementation: div0
index 68f161ce289f47e4dc805e01c84a9d04820b9d52..e0a9acd160868b6df356f9309872e3930a77c0d9 100644 (file)
@@ -236,7 +236,7 @@ float       FL_INWATER                              = 16;   // for enter / leave water splash
 float  FL_MONSTER                              = 32;
 float  FL_GODMODE                              = 64;   // player cheat
 float  FL_NOTARGET                             = 128;  // player cheat
-float  FL_ITEM                                 = 256;  // extra wide size for bonus items
+float  FL_ITEM                                 = 256;  // extra wide size for bonus items IF sv_legacy_bbox_expand is 1
 float  FL_ONGROUND                             = 512;  // standing on something
 float  FL_PARTIALGROUND                = 1024; // not all corners are valid
 float  FL_WATERJUMP                    = 2048; // player jumping out of water
index 86b0f5e87eb5feec570ee155f8fcacfd12a139de..582d037f575e90f65e662ae2ed0dd95fa8745c1b 100644 (file)
@@ -393,10 +393,11 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                                APPEND_TO_STRING(un_bannedservers, " ", s);
                                break;
                        }
-                       case "E":
+                       case "H":
                        {
-                               if(cvar("menu_updatecheck_getpacks"))
-                                       APPEND_TO_STRING(un_emergency_pk3s, " ", s);
+                               // Hotfix (version-specific pk3 supported in >= 0.8.6)
+                               // replaces "E" (missing-file-specific pk3 supported in <= 0.8.5)
+                               APPEND_TO_STRING(un_emergency_pk3s, " ", s);
                                break;
                        }
                        case "P":
@@ -469,8 +470,16 @@ void updateCheck()
                allgood = true;
                for(i = 0; i+1 < n; i += 2)
                {
-                       if(fexists(argv(i+1)))
+                       if(strcmp(argv(i+1), cvar_string("g_xonoticversion"))) // these aren't the versions we're looking for
                                continue;
+                       string packfn = whichpack("hotfix-autoexec.cfg");
+                       if(packfn) // we have the cfg we're looking for in some pk3
+                       {
+                               if(!strncmp(packfn, "dlcache/", 8)) // it's in dlcache
+                                       packfn = substring(packfn, 8, strlen(packfn)); // strip prefix "dlcache/"
+                               if(strstrofs(argv(i), packfn, strlen(argv(i)) - strlen(packfn)) > 0) // last chars of url == packfn
+                                       continue; // the pk3 we're looking for already provides the cfg we're looking for
+                       }
                        allgood = false;
                        if(_Nex_ExtResponseSystem_PacksStep == 1) // first run
                                localcmd("\ncurl --pak \"", argv(i), "\"\n");
@@ -482,14 +491,14 @@ void updateCheck()
                                if(!Menu_Active)
                                        cvar_set("_menu_initialized", "0");
                                        // HACK: cause m_hide call on next start
-                               localcmd("\nmenu_restart\n");
+                               //localcmd("\nmenu_restart\n"); // <= 0.8.5
+                               localcmd("\nexec hotfix-autoexec.cfg\n");
                        }
                        _Nex_ExtResponseSystem_PacksStep = 0;
                }
                else
                        _Nex_ExtResponseSystem_PacksStep = 2;
        }
-
 }
 
 float preMenuInit()
index a4e68e7da7bd3e9b5766c30925b54434a7d52b85..caa7a3c502b98854997fed6dea4fb202eea6c3ab 100644 (file)
@@ -366,13 +366,13 @@ bool MapVote_SendEntity(entity this, entity to, int sf)
                if ( gametypevote )
                {
                        // gametype vote
-                       WriteByte(MSG_ENTITY, 1);
+                       WriteByte(MSG_ENTITY, BIT(0)); // gametypevote_flags
                        WriteString(MSG_ENTITY, autocvar_nextmap);
                }
                else if ( autocvar_sv_vote_gametype )
                {
                        // map vote but gametype has been chosen via voting screen
-                       WriteByte(MSG_ENTITY, 2);
+                       WriteByte(MSG_ENTITY, BIT(1)); // gametypevote_flags
                        WriteString(MSG_ENTITY, MapInfo_Type_ToText(MapInfo_CurrentGametype()));
                }
                else
@@ -536,14 +536,14 @@ bool MapVote_CheckRules_2()
                if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
                {
                        RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
-                       if ( gametypevote &&  mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
+                       if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
                        {
                                currentVotes = mapvote_selections[i];
                                currentPlace = i;
                        }
                }
        firstPlaceVotes = RandomSelection_best_priority;
-       if ( autocvar_sv_vote_gametype_default_current && firstPlaceVotes == 0 )
+       if (gametypevote && autocvar_sv_vote_gametype_default_current && firstPlaceVotes == 0)
                firstPlace = currentPlace;
        else
                firstPlace = RandomSelection_chosen_float;
@@ -564,8 +564,12 @@ bool MapVote_CheckRules_2()
        if(firstPlace == -1)
                error("No first place in map vote... WTF?");
 
-       if(secondPlace == -1 || time > mapvote_timeout || (mapvote_voters_real - firstPlaceVotes) < firstPlaceVotes)
+       if(secondPlace == -1 || time > mapvote_timeout
+               || (mapvote_voters_real - firstPlaceVotes) < firstPlaceVotes
+               || mapvote_selections[mapvote_count - 1] == mapvote_voters)
+       {
                return MapVote_Finished(firstPlace);
+       }
 
        if(mapvote_keeptwotime)
                if(time > mapvote_keeptwotime || (mapvote_voters_real - firstPlaceVotes - secondPlaceVotes) < secondPlaceVotes)
@@ -825,7 +829,7 @@ bool GameTypeVote_Start()
 
        mapvote_count_real = mapvote_count;
 
-       gametypevote = 1;
+       gametypevote = true;
 
        if ( really_available == 0 )
        {
index 7bc8a84eabcc48a6995271ed59f1a221fe2933ac..ed8ef6ca1e206f85a9c0648045098b3b0ad74d53 100644 (file)
@@ -34,6 +34,6 @@ float GameTypeVote_Start();
 float GameTypeVote_Finished(float pos);
 string GameTypeVote_MapInfo_FixName(string m);
 
-float gametypevote;
+bool gametypevote;
 string getmapname_stored;
 float mapvote_initialized;
index add42efd325acc0eca59a8606dbbc9b027c42305..b434fdafa68e4da629048a3955f1b0e962a3e9be 100644 (file)
@@ -731,8 +731,6 @@ set cl_effects_lightningarc_drift_end 0.1
 set cl_effects_lightningarc_branchfactor_start 0.25
 set cl_effects_lightningarc_branchfactor_add 0.1
 
-set menu_updatecheck_getpacks 1 "get update packs from update server"
-
 seta cl_loddistance1 1024
 seta cl_loddistance2 3072
 seta cl_playerdetailreduction 4        "the higher, the less detailed player models are displayed (LOD)"