]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/modules
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 21 Aug 2016 04:44:45 +0000 (14:44 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 21 Aug 2016 04:45:23 +0000 (14:45 +1000)
# Conflicts:
# qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
# qcsrc/common/mutators/mutator/campcheck/campcheck.qc
# qcsrc/server/mutators/mutator/gamemode_domination.qh

43 files changed:
.gitlab-ci.yml
_hud_common.cfg
bal-wep-mario.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/hud_config.qh
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/main.qh
qcsrc/client/mutators/events.qh
qcsrc/client/view.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc
qcsrc/common/mutators/mutator/itemstime/itemstime.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/common/sounds/all.qh
qcsrc/common/stats.qh
qcsrc/common/triggers/triggers.qc
qcsrc/common/triggers/triggers.qh
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/dpdefs/upstream/dpextensions.qc
qcsrc/lib/csqcmodel/cl_model.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_domination.qh
qcsrc/server/player.qc
qcsrc/server/player.qh
qcsrc/server/steerlib.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/weapons/weaponsystem.qh

index 83a84305a7615708203d7e34a15b3b573b61fb17..8838f39c9734b2fbb015b615c68e645cb487dd22 100644 (file)
@@ -30,7 +30,7 @@ test_sv_game:
     - wget -O data/maps/g-23.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.cache
     - wget -O data/maps/g-23.waypoints.hardwired https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.hardwired
     - make
-    - EXPECT=6f94374cbd7ebda9ac951f92562022d8
+    - EXPECT=74f3802009cec230bdaa3b87235368ca
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 4f109944ba1d7f168484a28b0f8663b947394bf5..725bfe4e38b840dec5a7c4dc27c04f7028e503ce 100644 (file)
@@ -72,13 +72,18 @@ seta hud_panel_weapons_ammo_full_cells 180 "show 100% of the status bar at this
 seta hud_panel_weapons_ammo_full_plasma 180 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_rockets 160 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this ammo count"
+seta hud_panel_weapons_hide_ondeath 0 "hide this panel when dead"
 
 seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
+seta hud_panel_ammo_hide_ondeath 0 "hide this panel when dead"
+
+seta hud_panel_powerups_hide_ondeath 0 "hide this panel when dead"
 
 seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
 seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
 seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables the effect"
 seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blinks when health is lower than this amount"
+seta hud_panel_healtharmor_hide_ondeath 0 "hide this panel when dead"
 
 seta hud_panel_timer_increment "0" "show elapsed time instead of remaining time"
 
index 5979b78b84947acfbd6ca3790b0bb7e76ec7f4c1..f0fbb6291ccac30ea531630069396d56542c2c30 100644 (file)
@@ -61,7 +61,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_switchdelay_drop 0.2
 set g_balance_shotgun_switchdelay_raise 0.2
 set g_balance_shotgun_weaponreplace ""
-set g_balance_shotgun_weaponstart 0
+set g_balance_shotgun_weaponstart 1
 set g_balance_shotgun_weaponstartoverride -1
 set g_balance_shotgun_weaponthrowable 1
 // }}}
@@ -343,7 +343,7 @@ set g_balance_hagar_primary_lifetime 5
 set g_balance_hagar_primary_radius 65
 set g_balance_hagar_primary_refire 0.16667
 set g_balance_hagar_primary_speed 2200
-set g_balance_hagar_primary_spread 0.03
+set g_balance_hagar_primary_spread 0
 set g_balance_hagar_reload_ammo 0
 set g_balance_hagar_reload_time 2
 set g_balance_hagar_secondary 1
@@ -721,7 +721,7 @@ set g_balance_shockwave_melee_traces 10
 set g_balance_shockwave_switchdelay_drop 0.2
 set g_balance_shockwave_switchdelay_raise 0.2
 set g_balance_shockwave_weaponreplace ""
-set g_balance_shockwave_weaponstart 1
+set g_balance_shockwave_weaponstart 0
 set g_balance_shockwave_weaponstartoverride -1
 set g_balance_shockwave_weaponthrowable 0
 // }}}
index 61c54ae619f2a84a0dc3961916d6c44954a243b6..65a21972074e6806c5a864db6ed6dbe118fa421f 100644 (file)
@@ -210,6 +210,10 @@ bool autocvar_hud_panel_infomessages_dynamichud = false;
 bool autocvar_hud_panel_physics_dynamichud      = true;
 bool autocvar_hud_panel_centerprint_dynamichud  = true;
 bool autocvar_hud_panel_itemstime_dynamichud    = true;
+bool autocvar_hud_panel_healtharmor_hide_ondeath  = false;
+bool autocvar_hud_panel_ammo_hide_ondeath         = false;
+bool autocvar_hud_panel_powerups_hide_ondeath     = false;
+bool autocvar_hud_panel_weapons_hide_ondeath      = false;
 bool autocvar_hud_panel_ammo;
 bool autocvar_hud_panel_ammo_iconalign;
 int autocvar_hud_panel_ammo_maxammo;
@@ -392,7 +396,6 @@ float autocvar_hud_shownames_offset;
 string autocvar_hud_skin;
 float autocvar_menu_mouse_speed;
 string autocvar_menu_skin;
-float autocvar_r_drawviewmodel;
 int autocvar_r_fakelight;
 int autocvar_r_fullbright;
 float autocvar_r_letterbox;
@@ -452,4 +455,5 @@ vector autocvar_crosshair_rpc_color = '0.2 1.0 0.2';
 float autocvar_crosshair_rpc_alpha = 1;
 float autocvar_crosshair_rpc_size = 1;
 int autocvar_cl_nade_timer;
+bool autocvar_r_drawviewmodel;
 bool autocvar_cl_items_nofade;
index 8b23dd6fb95a6c8559877d99a1ed428c26e45249..91dc98fdcb2c32f7efa917bafd3b8912c1574644 100644 (file)
@@ -496,7 +496,7 @@ void HUD_Main()
 {
        int i;
        // global hud alpha fade (scoreboard-related panels behave differently and override it temporarly)
-       if(menu_enabled == 1)
+       if(hud_configure_menu_open == 1)
                hud_fade_alpha = 1;
        else if(!autocvar__hud_configure)
                hud_fade_alpha = (1 - scoreboard_fade_alpha) * (1 - autocvar__menu_alpha);
index 0dc89a8b4dffbb0b87ddeb4fcf12982409b506a7..7ee177524bea40d90eb5c547183ddba56a7859a4 100644 (file)
@@ -98,18 +98,11 @@ float weaponprevtime;
 
 float teamnagger;
 
-float hud_configure_checkcollisions;
-float hud_configure_prev;
-vector hud_configure_gridSize;
-vector hud_configure_realGridSize;
-
 int hudShiftState;
 const int S_SHIFT = 1;
 const int S_CTRL = 2;
 const int S_ALT = 4;
 
-float menu_enabled; // 1 showing the entire HUD, 2 showing only the clicked panel
-
 float hud_fade_alpha;
 
 string hud_skin_path;
@@ -316,7 +309,7 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
        if (autocvar__hud_configure) {                                                                                  \
                if (!panel_enabled)                                                                                         \
                        panel_bg_alpha = 0.25;                                                                                  \
-               else if (menu_enabled == 2 && panel == highlightedPanel)                                                    \
+               else if (hud_configure_menu_open == 2 && panel == highlightedPanel)                                                    \
                        panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
                else                                                                                                        \
                        panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);                                \
@@ -354,16 +347,16 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
 // return smoothly faded pos and size of given panel when a dialog is active
 // don't center too wide panels, it doesn't work with different resolutions
 #define HUD_Panel_UpdatePosSize_ForMenu() MACRO_BEGIN { \
-       vector menu_enable_size = panel_size; \
+       vector new_size = panel_size; \
        float max_panel_width = 0.52 * vid_conwidth; \
        if(panel_size.x > max_panel_width) \
        { \
-               menu_enable_size.x = max_panel_width; \
-               menu_enable_size.y = panel_size.y * (menu_enable_size.x / panel_size.x); \
+               new_size.x = max_panel_width; \
+               new_size.y = panel_size.y * (new_size.x / panel_size.x); \
        } \
-       vector menu_enable_pos = eX * (panel_bg_border + 0.5 * max_panel_width) + eY * 0.5 * vid_conheight - 0.5 * menu_enable_size; \
-       panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_pos; \
-       panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
+       vector new_pos = eX * (panel_bg_border + 0.5 * max_panel_width) + eY * 0.5 * vid_conheight - 0.5 * new_size; \
+       panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
+       panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
 } MACRO_END
 
 // Scale the pos and size vectors to absolute coordinates
@@ -396,7 +389,7 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
                HUD_Panel_GetPadding();                                                                                     \
                panel.current_panel_bg_alpha = panel_bg_alpha;                                                              \
                panel.current_panel_fg_alpha = panel_fg_alpha;                                                              \
-               if (menu_enabled == 2 && panel == highlightedPanel) {                                                       \
+               if (hud_configure_menu_open == 2 && panel == highlightedPanel) {                                                       \
                        HUD_Panel_UpdatePosSize_ForMenu();                                                                      \
                } else {                                                                                                    \
                        panel_bg_alpha *= hud_fade_alpha;                                                                       \
@@ -426,7 +419,7 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
        panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos")));                                  \
        panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size")));                                \
        HUD_Panel_ScalePosSize();                                                                                       \
-       if (menu_enabled == 2 && panel == highlightedPanel) {                                                           \
+       if (hud_configure_menu_open == 2 && panel == highlightedPanel) {                                                           \
                HUD_Panel_UpdatePosSize_ForMenu();                                                                          \
        }                                                                                                               \
        panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border"));                        \
index e28ff04b71f227df7d4a7f9cbc6bed225d95108d..654d49ba8c60f5ce9f59b3eb40bd2b24877d28fa 100644 (file)
@@ -237,9 +237,9 @@ void HUD_Panel_ExportCfg(string cfgname)
 
 void HUD_Configure_Exit_Force()
 {
-       if (menu_enabled)
+       if (hud_configure_menu_open)
        {
-               menu_enabled = 0;
+               hud_configure_menu_open = 0;
                localcmd("togglemenu\n");
        }
        cvar_set("_hud_configure", "0");
@@ -743,14 +743,14 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        {
                if (bInputType == 1)
                        return true;
-               menu_enabled = 1;
+               hud_configure_menu_open = 1;
                localcmd("menu_showhudexit\n");
        }
        else if(nPrimary == K_BACKSPACE && hudShiftState & S_CTRL)
        {
                if (bInputType == 1)
                        return true;
-               if (!menu_enabled)
+               if (!hud_configure_menu_open)
                        cvar_set("_hud_configure", "0");
        }
        else if(nPrimary == K_TAB && hudShiftState & S_CTRL) // switch panel
@@ -1098,7 +1098,7 @@ void HUD_Panel_Highlight(float allow_move)
 
 void HUD_Panel_EnableMenu()
 {
-       menu_enabled = 2;
+       hud_configure_menu_open = 2;
        localcmd("menu_showhudoptions ", highlightedPanel.panel_name, "\n");
 }
 float mouse_over_panel;
@@ -1197,7 +1197,7 @@ void HUD_Panel_Mouse()
        {
                if(prevMouseClicked)
                        highlightedAction = 0;
-               if(menu_enabled == 2)
+               if(hud_configure_menu_open == 2)
                        mouse_over_panel = 0;
                else
                        mouse_over_panel = HUD_Panel_Check_Mouse_Pos(true);
@@ -1264,7 +1264,7 @@ void HUD_Configure_Frame()
                if(autocvar__menu_alpha != _menu_alpha_prev)
                {
                        if(autocvar__menu_alpha == 0)
-                               menu_enabled = 0;
+                               hud_configure_menu_open = 0;
                        _menu_alpha_prev = autocvar__menu_alpha;
                }
 
@@ -1272,8 +1272,8 @@ void HUD_Configure_Frame()
        }
        else if(hud_configure_prev)
        {
-               if(menu_enabled)
-                       menu_enabled = 0;
+               if(hud_configure_menu_open)
+                       hud_configure_menu_open = 0;
                if(autocvar_hud_cursormode)
                        setcursormode(0);
                hud_dynamic_shake_factor = -1;
index 32c846076145def23fbe3bb769dfbbec2bb63473..6ab64f6aed2a7548f5b51dc36bbb012713c8c9e7 100644 (file)
@@ -8,6 +8,12 @@ int prevMouseClicked; // previous state
 float prevMouseClickedTime; // time during previous left mouse click, to check for doubleclicks
 vector prevMouseClickedPos; // pos during previous left mouse click, to check for doubleclicks
 
+float hud_configure_prev;
+float hud_configure_checkcollisions;
+vector hud_configure_gridSize;
+vector hud_configure_realGridSize;
+float hud_configure_menu_open; // 1 showing the entire HUD, 2 showing only the clicked panel
+
 void HUD_Panel_ExportCfg(string cfgname);
 
 void HUD_Panel_Mouse();
index 5c45ff0f331a1544be55bf6b4f3a262d7f704022..bd3ccd068160d9130db8f308fe28548a4c092dad 100644 (file)
@@ -98,8 +98,10 @@ void HUD_Ammo()
        if(hud != HUD_NORMAL) return;
        if(!autocvar__hud_configure)
        {
-               if(!autocvar_hud_panel_ammo) return;
-               if(spectatee_status == -1) return;
+               if((!autocvar_hud_panel_ammo) || (spectatee_status == -1))
+                       return;
+               if(STAT(HEALTH) < 1 && autocvar_hud_panel_ammo_hide_ondeath)
+                       return;
        }
 
        HUD_Panel_UpdateCvars();
index 5f9364e7a813c56f012fe464bd621166b31b792e..9dd5f05ff57d6152ba66c05ebdd154a1c2beb79c 100644 (file)
@@ -155,7 +155,7 @@ void HUD_CenterPrint ()
 
        // this panel fades only when the menu does
        float hud_fade_alpha_save = hud_fade_alpha;
-       if(menu_enabled == 1)
+       if(hud_configure_menu_open == 1)
                hud_fade_alpha = 1;
        else
                hud_fade_alpha = 1 - autocvar__menu_alpha;
index bc4291a948648e8eb5f8cf843c683cdc17d7ba1c..b56e390b35824802dc07db5bbe60c5f22541ae66 100644 (file)
@@ -8,19 +8,21 @@ void HUD_HealthArmor()
        int armor, health, fuel;
        if(!autocvar__hud_configure)
        {
-               if(!autocvar_hud_panel_healtharmor) return;
+               if((!autocvar_hud_panel_healtharmor) || (spectatee_status == -1))
+                       return;
                if(hud != HUD_NORMAL) return;
-               if(spectatee_status == -1) return;
 
                health = STAT(HEALTH);
                if(health <= 0)
                {
+                       health = 0;
                        prev_health = -1;
-                       return;
+                       if(autocvar_hud_panel_healtharmor_hide_ondeath)
+                               return;
                }
                armor = STAT(ARMOR);
 
-               // code to check for spectatee_status changes is in Ent_ClientData()
+               // code to check for spectatee_status changes is in ENT_CLIENT_CLIENTDATA
                // prev_p_health and prev_health can be set to -1 there
 
                if (prev_p_health == -1)
index 7f8703f5b685449e8341292fa1af5e3ede97515b..4779ab747999365cf458f889304a06893484cdef 100644 (file)
@@ -68,9 +68,10 @@ void HUD_Powerups()
        // Initialize items
        if(!autocvar__hud_configure)
        {
-               if(!autocvar_hud_panel_powerups) return;
-               if(spectatee_status == -1) return;
-               if(STAT(HEALTH) <= 0) return;
+               if((!autocvar_hud_panel_powerups) || (spectatee_status == -1))
+                       return;
+               if(STAT(HEALTH) <= 0 && autocvar_hud_panel_powerups_hide_ondeath)
+                       return;
                if(!(allItems & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) && !allBuffs) return;
 
                strengthTime = bound(0, STAT(STRENGTH_FINISHED) - time, 99);
index 66a834ea77ada751df758bdddc1a7c84093ea271..cd0d6fa32a887e6448fe25350ff896e1b185275b 100644 (file)
@@ -80,8 +80,9 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
                        if(tm.team == NUM_SPECTATOR)
                                continue;
-                       if(!tm.team && teamplay)
+                       if(!tm.team)
                                continue;
+
                        if (tm.team == myteam)
                                drawfill(pos + eX * score_size * i, eX * score_size + eY * fontsize.y, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores(ts_primary))), eX * score_size + eY * fontsize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -281,8 +282,9 @@ void HUD_Score()
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
                        if(tm.team == NUM_SPECTATOR)
                                continue;
-                       if(!tm.team && teamplay)
+                       if(!tm.team)
                                continue;
+
                        score = tm.(teamscores(ts_primary));
                        if(autocvar__hud_configure)
                                score = 123;
index 2e5fd943192f860f8d8bcbf7a049c66ac34d4b06..9762384faa0d68aca8ae04dc0bee7ff413717a26 100644 (file)
@@ -85,6 +85,7 @@ string TranslateScoresLabel(string l)
                case "rank": return CTX(_("SCO^rank"));
                case "returns": return CTX(_("SCO^returns"));
                case "revivals": return CTX(_("SCO^revivals"));
+               case "rounds": return CTX(_("SCO^rounds won"));
                case "score": return CTX(_("SCO^score"));
                case "suicides": return CTX(_("SCO^suicides"));
                case "takes": return CTX(_("SCO^takes"));
@@ -785,10 +786,7 @@ vector Scoreboard_DrawHeader(vector pos, vector rgb)
                        if (sbt_highlight)
                                if (!(i % 2))
                                {
-                                       if (i == sbt_num_fields-1)
-                                               column_dim.x = sbt_field_size[i] + hud_fontsize.x * 0.5;
-                                       else
-                                               column_dim.x = sbt_field_size[i] + hud_fontsize.x;
+                                       column_dim.x = sbt_field_size[i] + hud_fontsize.x;
                                        drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL);
                                }
 
@@ -808,8 +806,6 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
     TC(bool, is_self); TC(int, pl_number);
        string str;
        bool is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR);
-       if(is_spec && !is_self)
-               rgb = '0 0 0';
 
        vector h_pos = item_pos;
        vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25;
@@ -1070,7 +1066,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
 
                // row highlighting
                for (int i = 0; i < rows; ++i)
-                       drawfill(pos + eY * weapon_height + eY * height * i, eX * tmp.x + eY * fontsize, '1 1 1', sbt_highlight_alpha, DRAWFLAG_NORMAL);
+                       drawfill(pos + eY * weapon_height + eY * height * i, eX * tmp.x + eY * fontsize, rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL);
        }
 
        average_accuracy = 0;
@@ -1287,7 +1283,7 @@ void Scoreboard_Draw()
        {
                // frametime checks allow to toggle the scoreboard even when the game is paused
                if(scoreboard_active) {
-                       if(menu_enabled == 1)
+                       if(hud_configure_menu_open == 1)
                                scoreboard_fade_alpha = 1;
                        float scoreboard_fadeinspeed = autocvar_hud_panel_scoreboard_fadeinspeed;
                        if (scoreboard_fadeinspeed && frametime)
@@ -1315,7 +1311,7 @@ void Scoreboard_Draw()
                HUD_Scale_Disable();
 
        float hud_fade_alpha_save = hud_fade_alpha;
-       if(menu_enabled == 1)
+       if(hud_configure_menu_open == 1)
                hud_fade_alpha = 1;
        else
                hud_fade_alpha = scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
@@ -1370,7 +1366,7 @@ void Scoreboard_Draw()
                {
                        if(tm.team == NUM_SPECTATOR)
                                continue;
-                       if(!tm.team && teamplay)
+                       if(!tm.team)
                                continue;
 
                        draw_beginBoldFont();
@@ -1400,8 +1396,6 @@ void Scoreboard_Draw()
                {
                        if(tm.team == NUM_SPECTATOR)
                                continue;
-                       if(!tm.team && teamplay)
-                               continue;
 
                        pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size);
                }
@@ -1431,7 +1425,7 @@ void Scoreboard_Draw()
                if(pl.team != NUM_SPECTATOR)
                        continue;
                pos.y += 1.25 * hud_fontsize.y;
-               Scoreboard_DrawItem(pos, panel_bg_color, pl, (pl.sv_entnum == player_localnum), specs);
+               Scoreboard_DrawItem(pos, '0 0 0', pl, (pl.sv_entnum == player_localnum), specs);
                ++specs;
        }
 
index c3208896ee982f8bc23e894f767791900c9ab6c7..fe2aefc60d1c3fe5f123c49386a235ccb3cc2b8b 100644 (file)
@@ -70,6 +70,8 @@ void HUD_Weapons()
        {
                if((!autocvar_hud_panel_weapons) || (spectatee_status == -1))
                        return;
+               if(STAT(HEALTH) <= 0 && autocvar_hud_panel_weapons_hide_ondeath)
+                       return;
                if(timeout && time >= weapontime + timeout + timeout_effect_length)
                if(autocvar_hud_panel_weapons_timeout_effect == 3 || (autocvar_hud_panel_weapons_timeout_effect == 1 && !(autocvar_hud_panel_weapons_timeout_fadebgmin + autocvar_hud_panel_weapons_timeout_fadefgmin)))
                {
@@ -149,7 +151,7 @@ void HUD_Weapons()
        {
                if(autocvar__hud_configure)
                {
-                       if(menu_enabled != 2)
+                       if(hud_configure_menu_open != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
                }
 
index 49167845d414d56a6dfa68d77b58330246baa8ea..9da7547299dd013e27e8e93731fc7599b70948f3 100644 (file)
@@ -126,7 +126,7 @@ const int HOOK_END =      2;
 
 float g_trueaim_minrange;
 
-float hud;
+int hud;
 float view_quality;
 
 int num_spectators;
index b72f7abe1a3bdcb8cef50d10333d6f997259299a..a852fdbe472437e96c4ffbbf9a2f5bd498f2335a 100644 (file)
@@ -142,3 +142,6 @@ MUTATOR_HOOKABLE(DrawGrapplingHook, EV_DrawGrapplingHook);
        /** is new to client */ i(bool, MUTATOR_ARGV_1_bool) \
        /**/
 MUTATOR_HOOKABLE(Ent_Update, EV_Ent_Update);
+
+/** Return true to not draw crosshair */
+MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS);
index 336707d3cf96fc7c0bf78bc7f6ebd263156fe818..c629ab30c32bdd33987f3f087f465ee88f15a56c 100644 (file)
@@ -937,7 +937,7 @@ void HUD_Crosshair(entity this)
        float f, i, j;
        vector v;
        if(!scoreboard_active && !camera_active && intermission != 2 &&
-               spectatee_status != -1 && !csqcplayer.viewloc &&
+               spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
                !HUD_MinigameMenu_IsOpened() )
        {
                if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
@@ -1337,6 +1337,11 @@ void HUD_Draw(entity this)
                DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * STAT(NADE_TIMER)) - ('0 1 1' * STAT(NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
                drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
        }
+       else if(STAT(CAPTURE_PROGRESS))
+       {
+               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+       }
        else if(STAT(REVIVE_PROGRESS))
        {
                DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
@@ -1368,6 +1373,7 @@ float oldr_useportalculling;
 float oldr_useinfinitefarclip;
 
 void cl_notice_run();
+
 float prev_myteam;
 int lasthud;
 float vh_notice_time;
@@ -1825,8 +1831,7 @@ void CSQC_UpdateView(entity this, float w, float h)
        else if(csqcplayer.viewloc) { setproperty(VF_FOV, GetViewLocationFOV(110)); } // enforce 110 fov, so things dont look odd
        else { setproperty(VF_FOV, GetCurrentFov(fov)); }
 
-       // Camera for demo playback
-       if(camera_active)
+       if(camera_active) // Camera for demo playback
        {
                if(autocvar_camera_enable)
                        CSQC_Demo_Camera();
index 9551e9d85ee34b035820bbc5d32c513cce6af9b0..f57625607a4114333779798d067adbcc23bba5a6 100644 (file)
@@ -1122,7 +1122,7 @@ bool Onslaught_CheckWinner()
        round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit);
 
        FOREACH_CLIENT(IS_PLAYER(it), {
-               it.ons_roundlost = true;
+               STAT(ROUNDLOST, it) = true;
                it.player_blocked = true;
 
                nades_Clear(it);
@@ -1605,7 +1605,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe
 MUTATOR_HOOKFUNCTION(ons, reset_map_global)
 {
        FOREACH_CLIENT(IS_PLAYER(it), {
-               it.ons_roundlost = false;
+               STAT(ROUNDLOST, it) = false;
                it.ons_deathloc = '0 0 0';
                PutClientInServer(it);
        });
@@ -1880,7 +1880,7 @@ MUTATOR_HOOKFUNCTION(ons, SpectateCopy)
        entity spectatee = M_ARGV(0, entity);
        entity client = M_ARGV(1, entity);
 
-       client.ons_roundlost = spectatee.ons_roundlost; // make spectators see it too
+       STAT(ROUNDLOST, client) = STAT(ROUNDLOST, spectatee); // make spectators see it too
 }
 
 MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand)
index f70ba3c55c678e2c0470c07ce620d3356251266d..70a5c8b6ba999078cb459c8933e2c11f7ab660e8 100644 (file)
@@ -73,8 +73,6 @@ bool ons_stalemate;
 
 .float teleport_antispam;
 
-.bool ons_roundlost = _STAT(ROUNDLOST);
-
 // waypoint sprites
 .entity bot_basewaypoint; // generator waypointsprite
 
index 9a45e856a74570c704ca9d6497c662b296ca1ee3..a4f7e6acaace738772fd366d81f499b57a4cdf7c 100644 (file)
@@ -92,6 +92,7 @@ bool Monster_ValidTarget(entity this, entity targ)
        || (SAME_TEAM(targ, this))
        || (STAT(FROZEN, targ))
        || (targ.alpha != 0 && targ.alpha < 0.5)
+       || (MUTATOR_CALLHOOK(MonsterValidTarget, this, targ))
        )
        {
                // if any of the above checks fail, target is not valid
index be7d3a2e2bbf3372029df5ea66db773525d87dc5..c4d2e030267114b46cba723d8322a614a0d8de26 100644 (file)
@@ -40,6 +40,7 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink)
        if(IS_PLAYER(player))
        if(IS_REAL_CLIENT(player)) // bots may camp, but that's no reason to constantly kill them
        if(!IS_DEAD(player))
+       if(!forbidWeaponUse(player))
        if(!STAT(FROZEN, player))
        if(!PHYS_INPUT_BUTTON_CHAT(player))
        if(autocvar_g_campcheck_interval)
index 0c348b62410d48310e5c9f8d139b33c72c0fdde7..3fe9de6d7d5f849ea9356d04b6930a59caf76769 100644 (file)
@@ -331,7 +331,7 @@ void HUD_ItemsTime()
     if (autocvar_hud_panel_itemstime_dynamicsize)
     {
         if (autocvar__hud_configure)
-        if (menu_enabled != 2)
+        if (hud_configure_menu_open != 2)
             HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
 
         // reduce panel to avoid spacing items
index 4c57d018950d4445e061924bfa4c000b3a962ddf..fb14f27db8063cb22d96b1dd9baad197b2f545d2 100644 (file)
@@ -88,6 +88,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                        if(it.msnt_timer < time)
                        if(SAME_TEAM(player, it))
                        if(time > it.spawnshieldtime) // spawn shielding
+                       if(!forbidWeaponUse(it))
                        if(STAT(FROZEN, it) == 0)
                        if(it != player)
                        {
index 763aae67cfac58bb0b48fb599823b58500635d51..b7b296341b5a02ba5829035e158f13ad673cbefe 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "sound.qh"
 
-REGISTRY(Sounds, BITS(8))
+REGISTRY(Sounds, BITS(9))
 #define Sounds_from(i) _Sounds_from(i, SND_Null)
 REGISTER_REGISTRY(Sounds)
 
index 61a4bfeaed25cd8aa48f0f3be33ccc37fa99219a..d6aa068ea67eb775da3cba979c9a62398e9cbcf2 100644 (file)
@@ -121,6 +121,7 @@ REGISTER_STAT(REVIVE_PROGRESS, float)
 REGISTER_STAT(ROUNDLOST, int)
 REGISTER_STAT(BUFF_TIME, float)
 REGISTER_STAT(CTF_FLAGSTATUS, int)
+REGISTER_STAT(CAPTURE_PROGRESS, float)
 REGISTER_STAT(ENTRAP_ORB, float)
 REGISTER_STAT(ENTRAP_ORB_ALPHA, float)
 REGISTER_STAT(ITEMSTIME, int, autocvar_sv_itemstime)
index 849d3e8acb27ef9efba748c6ab5bab0b14178ab7..81144aae7f883b382cdf903aabd6cc64e32ca084 100644 (file)
@@ -163,6 +163,7 @@ void trigger_remove_generic(entity this)
 }
 #endif
 
+
 /*
 ==============================
 SUB_UseTargets
@@ -182,7 +183,8 @@ match (string)this.target and call their .use function
 
 ==============================
 */
-void SUB_UseTargets(entity this, entity actor, entity trigger)
+
+void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventReuse)
 {
 //
 // check for a delay
@@ -253,7 +255,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
                        int aw_flag = this.antiwall_flag;
                        for(entity t = NULL; (t = find(t, targetname, s)); )
                        {
-                               if(t.use)
+                               if(t.use && (t.sub_target_used != time || !preventReuse))
                                {
                                        if(this.target_random)
                                        {
@@ -265,6 +267,8 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
                                                        t.antiwall_flag = aw_flag;
 
                                                t.use(t, actor, this);
+                                               if(preventReuse)
+                                                       t.sub_target_used = time;
                                        }
                                }
                        }
@@ -272,9 +276,16 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
        }
 
        if(this.target_random && RandomSelection_chosen_ent)
+       {
                RandomSelection_chosen_ent.use(RandomSelection_chosen_ent, actor, this);
+               if(preventReuse)
+                       RandomSelection_chosen_ent.sub_target_used = time;
+       }
 }
 
+void SUB_UseTargets(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, false); }
+void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, true); }
+
 void SUB_UseTargets_self(entity this)
 {
        SUB_UseTargets(this, NULL, NULL);
index 8a8eb566c19b2ed844035390e6236e78fd1e18b3..2b8274f4b890aa473b5432de2415bb1719e925a1 100644 (file)
@@ -27,8 +27,12 @@ string trigger_magicear_processmessage_forallears(entity source, float teamsay,
 
 void target_voicescript_next(entity pl);
 void target_voicescript_clear(entity pl);
+
+void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger);
 #endif
 
+.float sub_target_used;
+
 .float volume, atten;
 
 .vector dest;
index 55652bb2326d9bc0004d7a00f6e5c41727334a0e..de7726f24f225b1d22d9586bf4b695d92bfa6093 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(Shockwave, Weapon)
 /* ammotype  */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none);
 /* impulse   */ ATTRIB(Shockwave, impulse, int, 2);
-/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
+/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
 /* rating    */ ATTRIB(Shockwave, bot_pickupbasevalue, float, BOT_PICKUP_RATING_LOW);
 /* color     */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
 /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
index 21060c82ef428625bcafe4986ff652b230773f4b..2f49d97bb88b184360d72b378a602d1f03f395da 100644 (file)
@@ -2599,3 +2599,12 @@ void coverage() = #642;  // Reports a coverage event. The engine counts for each
 float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
 //description:
 //use -1 as buffer handle to justs end delim as postdata
+
+//DP_USERMOVETYPES
+//idea: divVerent
+//darkplaces implementation: Mario
+//movetype definitions:
+float MOVETYPE_USER_FIRST = 128;
+float MOVETYPE_USER_LAST = 191;
+//description:
+//user defined movetypes can be added between the start and end points, without producing unknown movetype warnings
index 6b86092967e67dd5b9638bafce9585ebfbec16fb..7f55a3c10f13b6a62518533321513a2f3fc02196 100644 (file)
@@ -194,6 +194,14 @@ void CSQCModel_Draw(entity this)
 
        CSQCModel_Hook_PreDraw(this, isplayer);
 
+       if(isplayer)
+       {
+               if(this.entnum == player_localentnum)
+                       this.renderflags |= RF_EXTERNALMODEL;
+               else
+                       this.renderflags &= ~RF_EXTERNALMODEL;
+       }
+
        // inherit draw flags easily
        entity root = this;
        while(root.tag_entity)
index f233bb7d8f41c5612ce300dc99862c202912b9ae..a6bd1552d2250d7c0a2ee1895173586b4f9ab81f 100644 (file)
@@ -416,7 +416,6 @@ const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
 #define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
 
-
 ////
 
 .entity player_stats;
index 657ac07cb683243d78b0d034b8822f73d4122eee..5b63aa4e0c99c3e52389d6c6bf9ae1826895aa8f 100644 (file)
@@ -1980,6 +1980,34 @@ string GotoMap(string m)
                return "Map switch will happen after scoreboard.";
 }
 
+bool autocvar_sv_gameplayfix_multiplethinksperframe;
+void RunThink(entity this)
+{
+       // don't let things stay in the past.
+       // it is possible to start that way by a trigger with a local time.
+       if(this.nextthink <= 0 || this.nextthink > time + frametime)
+               return;
+
+       float oldtime = time; // do we need to save this?
+
+       for (int iterations = 0; iterations < 128 && !wasfreed(this); iterations++)
+       {
+               time = max(oldtime, this.nextthink);
+               this.nextthink = 0;
+
+               if(getthink(this))
+                       getthink(this)(this);
+               // mods often set nextthink to time to cause a think every frame,
+               // we don't want to loop in that case, so exit if the new nextthink is
+               // <= the time the qc was told, also exit if it is past the end of the
+               // frame
+               if(this.nextthink <= time || this.nextthink > oldtime + frametime || !autocvar_sv_gameplayfix_multiplethinksperframe)
+                       break;
+       }
+
+       time = oldtime;
+}
+
 bool autocvar_sv_freezenonclients;
 bool autocvar_sv_gameplayfix_delayprojectiles;
 void Physics_Frame()
@@ -2008,6 +2036,13 @@ void Physics_Frame()
 
                if(it.move_qcphysics)
                        Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false);
+
+               if(it.movetype >= MOVETYPE_USER_FIRST && it.movetype <= MOVETYPE_USER_LAST) // these cases have no think handling
+               {
+                       // handle thinking here
+                       if (getthink(it) && it.nextthink > 0 && it.nextthink <= time + frametime)
+                               RunThink(it);
+               }
        });
 
        if(autocvar_sv_gameplayfix_delayprojectiles >= 0)
index 530e43f4a6a0392e2bd6d10b66a929829d5f9136..58cd949297acefe1af5e3e48d65f8f098f6c58b4 100644 (file)
@@ -97,7 +97,7 @@ void GameLogEcho(string s)
     }
     if (autocvar_sv_eventlog_console)
     {
-        LOG_INFO(s, "\n");
+        dedicated_print(strcat(s, "\n"));
     }
 }
 
index 89021e3237a12c22dd4b7429384d99d84485ef39..ae0fd211c275d0797ae2eb66cfda14416af36e55 100644 (file)
@@ -271,6 +271,15 @@ MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
 /** called when a monster looks for another target */
 MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
 
+/**
+ * called when validating a monster's target
+ */
+#define EV_MonsterValidTarget(i, o) \
+    /** monster */       i(entity, MUTATOR_ARGV_0_entity) \
+    /** target */        i(entity, MUTATOR_ARGV_1_entity) \
+    /**/
+MUTATOR_HOOKABLE(MonsterValidTarget, EV_MonsterValidTarget);
+
 /** called to change a random monster to a miniboss */
 #define EV_MonsterCheckBossFlag(i, o) \
     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
@@ -837,3 +846,19 @@ MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
        /** data */     i(string, MUTATOR_ARGV_2_string) \
     /**/
 MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback);
+
+/**
+ * return true to prevent weapon use for a player
+ */
+ #define EV_ForbidWeaponUse(i, o) \
+    /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+    /**/
+MUTATOR_HOOKABLE(ForbidWeaponUse, EV_ForbidWeaponUse);
+
+/** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
+#define EV_CopyBody(i, o) \
+    /** player */               i(entity, MUTATOR_ARGV_0_entity) \
+    /** newly created clone */  i(entity, MUTATOR_ARGV_1_entity) \
+    /** keepvelocity? */        i(bool, MUTATOR_ARGV_2_bool) \
+    /**/
+MUTATOR_HOOKABLE(CopyBody, EV_CopyBody);
index eb2379ca2291d10ec7d76de1e5eaed9c4fac3f28..e9eb2c2d9da3e4ca46189662785cc13c62f08f2e 100644 (file)
@@ -59,3 +59,5 @@ float pps_pink;
 // misc globals
 float domination_roundbased;
 float domination_teams;
+
+void AnimateDomPoint(entity this);
index 5316a85b587ef90bf72a26cd1de13936eec09252..f2ceecf9ee4596d1cc9125da2dc7513f69f13c25 100644 (file)
@@ -125,6 +125,8 @@ void CopyBody(entity this, float keepvelocity)
        // "bake" the current animation frame for clones (they don't get clientside animation)
        animdecide_load_if_needed(clone);
        animdecide_setframes(clone, false, frame, frame1time, frame2, frame2time);
+
+       MUTATOR_CALLHOOK(CopyBody, this, clone, keepvelocity);
 }
 
 void player_setupanimsformodel(entity this)
index b5f8ca07c8d4a5dc81db14099d86f597405b2827..3e2b860162203e798733f441d3e35dcd07405bd7 100644 (file)
@@ -9,6 +9,8 @@
 void CopyBody_Think(entity this);
 void CopyBody(entity this, float keepvelocity);
 
+void dedicated_print(string input);
+
 void player_setupanimsformodel(entity this);
 
 void player_anim(entity this);
index 8064cd9ae12ecde6f8672058a7cfb798520e6d13..c69230d88fce5f09b5d277f13ae72a15c8c451e8 100644 (file)
@@ -339,24 +339,30 @@ vector steerlib_traceavoid_flat(entity this, float pitch, float length, vector v
     return normalize(leftwish + rightwish + frontwish);
 }
 
-float beamsweep_badpoint(vector point,float waterok)
+bool beamsweep_badpoint(vector point, bool waterok)
 {
-    float pc,pc2;
-
     if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
-        return 1;
-
-    pc  = pointcontents(point);
-    pc2 = pointcontents(point - '0 0 1');
-
-    switch(pc)
+        return true;
+
+    int pc = pointcontents(point);
+    int pc2 = pointcontents(point - '0 0 1');
+    
+    if(pc == CONTENT_EMPTY && pc2 == CONTENT_SOLID)
+        return false;
+    if(pc == CONTENT_EMPTY && pc2 == CONTENT_WATER && waterok)
+        return false;
+    if(pc == CONTENT_WATER && waterok)
+        return false;
+    return true;
+
+    /*switch(pc)
     {
         case CONTENT_SOLID: break;
         case CONTENT_SLIME: break;
         case CONTENT_LAVA:  break;
 
         case CONTENT_SKY:
-            return 1;
+            return true;
 
         case CONTENT_EMPTY:
             if (pc2 == CONTENT_SOLID)
@@ -375,14 +381,14 @@ float beamsweep_badpoint(vector point,float waterok)
             break;
     }
 
-    return 1;
+    return true;*/
 }
 
 //#define BEAMSTEER_VISUAL
 float beamsweep(entity this, vector from, vector dir,float length, float step,float step_up, float step_down)
 {
     float i;
-    vector a,b,u,d;
+    vector a, b, u, d;
 
     u = '0 0 1' * step_up;
     d = '0 0 1' * step_down;
@@ -464,8 +470,8 @@ vector steerlib_beamsteer(entity this, vector dir, float length, float step, flo
 
     if(bm_left + bm_right < 0.15)
     {
-        vr = normalize((v_forward*-1) + v_right * 0.75);
-        vl = normalize((v_forward*-1) - v_right * 0.75);
+        vr = normalize((v_forward*-1) + v_right * 0.90);
+        vl = normalize((v_forward*-1) - v_right * 0.90);
 
         bm_right = beamsweep(this, this.origin, vr, length, step, step_up, step_down);
         bm_left  = beamsweep(this, this.origin, vl, length, step, step_up, step_down);
index a193423783563ead129785941da806efdfedff3c..f429628b01a05d1d82541292fbeeb14aa2989cf5 100644 (file)
@@ -473,8 +473,10 @@ float FindSmallestTeam(entity pl, float ignore_pl)
        {
                if(autocvar_g_campaign && pl && IS_REAL_CLIENT(pl))
                        return 1; // special case for campaign and player joining
-               else
-                       error(sprintf("Too few teams available for %s\n", MapInfo_Type_ToString(MapInfo_CurrentGametype())));
+               else if(totalteams == 1) // single team
+                       LOG_TRACEF("Only 1 team available for %s, you may need to fix your map", MapInfo_Type_ToString(MapInfo_CurrentGametype()));
+               else // no teams, major no no
+                       error(sprintf("No teams available for %s\n", MapInfo_Type_ToString(MapInfo_CurrentGametype())));
        }
 
        // count how many players are in each team
index 68714da33867d5f8eb8ba433b997ed5058118b0d..176b69e6b6c9e5f720f2dfc09fb9af13367c1ff8 100644 (file)
@@ -22,7 +22,7 @@
 // make sure you call makevectors first (FIXME?)
 void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vector s_forward, vector mi, vector ma, float antilag, float recoil, Sound snd, float chan, float maxdamage, float range)
 {
-    TC(Sound, snd);
+       TC(Sound, snd);
        float nudge = 1; // added to traceline target and subtracted from result  TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
        float oldsolid;
        vector vecs, dv;
@@ -475,7 +475,10 @@ void fireBullet(entity this, vector start, vector dir, float spread, float max_s
                        break;
 
                float dist_taken = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - start));
-               solid_penetration_left *= (dist_taken / maxdist);
+               // fraction_used_of_what_is_left = dist_taken / maxdist
+               // solid_penetration_left = solid_penetration_left - solid_penetration_left * fraction_used_of_what_is_left
+               solid_penetration_left *= 1 - dist_taken / maxdist;
+               solid_penetration_left = max(solid_penetration_left, 0);
 
                // Only show effect when going through a player (invisible otherwise)
                if (hit && (hit.solid != SOLID_BSP))
index 1e42121529f8940c4102dfb31f7e8b8b37b3f63e..13f32ee14d2a76e9cae1ec69dea3d01b3fa4c1e9 100644 (file)
@@ -412,6 +412,7 @@ bool forbidWeaponUse(entity player)
        if (gameover) return true;
        if (STAT(FROZEN, player)) return true;
        if (player.weapon_blocked) return true;
+       if (MUTATOR_CALLHOOK(ForbidWeaponUse, player)) return true;
        return false;
 }
 
index d0ba63412198f1d6c016484965a0aba1c610fc87..b7ca597046fea210e290d2a00af5b10ef6a3367b 100644 (file)
@@ -8,7 +8,7 @@ void CL_SpawnWeaponentity(entity e, .entity weaponentity);
 
 vector CL_Weapon_GetShotOrg(float wpn);
 
-float forbidWeaponUse(entity player);
+bool forbidWeaponUse(entity player);
 
 void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector offset);