- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=62fd4d2a4124374b7e0cc1aff445cd88
+ - EXPECT=b06a71529b1664383cc6567fbb3f1257
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
# xonotic build system overrides this by command line argument to turn off the check-cvars step
XON_BUILDSYSTEM =
-all: qc
+.PHONY: all
+all: check-cvars
+ $(MAKE) -C qcsrc all
.PHONY: check-cvars
check-cvars:
.PHONY: qc
qc: check-cvars
- $(MAKE) -C qcsrc
+ $(MAKE) -C qcsrc qc
.PHONY: skin
skin: gfx/menu/default/skinvalues.txt
// Main options
// ==============
set g_physics_clientselect 0 "allow clients to select their physics set"
-set g_physics_clientselect_options "xonotic nexuiz quake warsow defrag quake3 vecxis quake2 bones overkill"
+set g_physics_clientselect_options "xonotic nexuiz quake warsow defrag quake3 vecxis quake2 bones"
set g_physics_clientselect_default "" "override default physics"
// =========
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 400
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
g_mod_physics Havoc
-// Xonotic Havoc physics (work in progress)
+// Nexuiz Havoc physics (work in progress)
sv_gravity 800
sv_maxspeed 400
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
+sv_gameplayfix_stepdown_maxspeed 400
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 320
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max_disable_on_ramps 0
g_teleport_maxspeed 0
sv_track_canjump 0
+sv_gameplayfix_stepdown_maxspeed 0
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
+sv_gameplayfix_stepdown_maxspeed 400
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
+sv_gameplayfix_stepdown_maxspeed 400
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
+sv_gameplayfix_stepdown_maxspeed 400
sv_jumpspeedcap_max 0.5
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 600
+sv_gameplayfix_stepdown_maxspeed 400
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
g_teleport_maxspeed 0
+sv_gameplayfix_stepdown_maxspeed 400
int autocvar__cl_playerskin;
string autocvar__cl_playermodel;
float autocvar_cl_deathglow;
+float autocvar_cl_deathglow_min = 0.5;
bool autocvar_developer_csqcentities;
float autocvar_cl_jetpack_attenuation = 2;
bool autocvar_cl_showspectators;
#include "csqcmodel_hooks.qh"
#include "autocvars.qh"
-#include "csqcmodel_hooks.qh"
#include "miscfunctions.qh"
#include <client/mutators/_mod.qh>
#include "player_skeleton.qh"
int forceplayermodels_goodmodelindex;
.vector glowmod;
-.vector old_glowmod;
void CSQCPlayer_ModelAppearance_PreUpdate(entity this)
{
{
if(this.csqcmodel_isdead)
{
- // Fade out to black now...
- if(this.old_glowmod == '0 0 0') { this.old_glowmod = this.glowmod; }
- this.colormap = 0;
-
- this.glowmod = this.old_glowmod * bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
- this.glowmod_x = max(this.glowmod.x, 0.0001);
- this.glowmod_y = max(this.glowmod.y, 0.0001);
- this.glowmod_z = max(this.glowmod.z, 0.0001);
+ float min_factor = bound(0, autocvar_cl_deathglow_min, 1);
+ if(this.colormap > 0)
+ min_factor /= 2;
+ float glow_fade = bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
+ this.glowmod *= (min_factor + glow_fade * (1 - min_factor));
+ if (this.glowmod == '0 0 0')
+ this.glowmod.x = 0.000001;
}
- else if(this.old_glowmod != '0 0 0') { this.old_glowmod = '0 0 0'; }
}
//printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
#define hud_panels_from(i) _hud_panels_from(i, NULL)
REGISTER_REGISTRY(hud_panels)
-#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
+#define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags) \
void draw_func(); \
+ void export_func(int fh); \
REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \
this.panel_id = this.m_id; \
this.panel_draw = draw_func; \
+ this.panel_export = export_func; \
this.panel_name = strzone(strtolower(#id)); \
this.panel_configflags = configflags; \
this.panel_showflags = showflags; \
}
+#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
+ _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags)
+
#define HUD_PANEL(NAME) HUD_PANEL_##NAME
// draw the background/borders
string panel_bg_padding_str;
classfield(HUDPanel) .void() panel_draw;
+classfield(HUDPanel) .void(int fh) panel_export;
// chat panel can be reduced / moved while the mapvote is active
// let know the mapvote panel about chat pos and size
#include <client/miscfunctions.qh>
#include <client/view.qh>
-#define HUD_Write(s) fputs(fh, s)
-#define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
-#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
// Save the config
void HUD_Panel_ExportCfg(string cfgname)
{
HUD_Write_PanelCvar("_bg_alpha");
HUD_Write_PanelCvar("_bg_border");
HUD_Write_PanelCvar("_bg_padding");
- switch(panel) {
- case HUD_PANEL_WEAPONS:
- HUD_Write_Cvar("hud_panel_weapons_accuracy");
- HUD_Write_Cvar("hud_panel_weapons_label");
- HUD_Write_Cvar("hud_panel_weapons_label_scale");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_time");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave");
- HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable");
- HUD_Write_Cvar("hud_panel_weapons_ammo");
- HUD_Write_Cvar("hud_panel_weapons_ammo_color");
- HUD_Write_Cvar("hud_panel_weapons_ammo_alpha");
- HUD_Write_Cvar("hud_panel_weapons_aspect");
- HUD_Write_Cvar("hud_panel_weapons_timeout");
- HUD_Write_Cvar("hud_panel_weapons_timeout_effect");
- HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin");
- HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin");
- HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
- HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
- HUD_Write_Cvar("hud_panel_weapons_onlyowned");
- HUD_Write_Cvar("hud_panel_weapons_orderbyimpulse");
- HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
- HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
- HUD_Write_Cvar("hud_panel_weapons_selection_radius");
- HUD_Write_Cvar("hud_panel_weapons_selection_speed");
- break;
- case HUD_PANEL_AMMO:
- HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
- HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
- HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
- HUD_Write_Cvar("hud_panel_ammo_iconalign");
- HUD_Write_Cvar("hud_panel_ammo_progressbar");
- HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
- HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
- HUD_Write_Cvar("hud_panel_ammo_text");
- break;
- case HUD_PANEL_POWERUPS:
- HUD_Write_Cvar("hud_panel_powerups_iconalign");
- HUD_Write_Cvar("hud_panel_powerups_baralign");
- HUD_Write_Cvar("hud_panel_powerups_progressbar");
- HUD_Write_Cvar("hud_panel_powerups_text");
- break;
- case HUD_PANEL_HEALTHARMOR:
- HUD_Write_Cvar("hud_panel_healtharmor_combined");
- HUD_Write_Cvar("hud_panel_healtharmor_flip");
- HUD_Write_Cvar("hud_panel_healtharmor_iconalign");
- HUD_Write_Cvar("hud_panel_healtharmor_baralign");
- HUD_Write_Cvar("hud_panel_healtharmor_progressbar");
- HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health");
- HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor");
- HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx");
- HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth");
- HUD_Write_Cvar("hud_panel_healtharmor_text");
- break;
- case HUD_PANEL_NOTIFY:
- HUD_Write_Cvar("hud_panel_notify_flip");
- HUD_Write_Cvar("hud_panel_notify_fontsize");
- HUD_Write_Cvar("hud_panel_notify_time");
- HUD_Write_Cvar("hud_panel_notify_fadetime");
- HUD_Write_Cvar("hud_panel_notify_icon_aspect");
- break;
- case HUD_PANEL_TIMER:
- break;
- case HUD_PANEL_RADAR:
- HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
- HUD_Write_Cvar("hud_panel_radar_rotation");
- HUD_Write_Cvar("hud_panel_radar_zoommode");
- HUD_Write_Cvar("hud_panel_radar_scale");
- HUD_Write_Cvar("hud_panel_radar_maximized_scale");
- HUD_Write_Cvar("hud_panel_radar_maximized_size");
- HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
- HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
- break;
- case HUD_PANEL_SCORE:
- HUD_Write_Cvar("hud_panel_score_rankings");
- break;
- case HUD_PANEL_VOTE:
- HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha");
- break;
- case HUD_PANEL_MODICONS:
- HUD_Write_Cvar("hud_panel_modicons_ca_layout");
- HUD_Write_Cvar("hud_panel_modicons_dom_layout");
- HUD_Write_Cvar("hud_panel_modicons_freezetag_layout");
- break;
- case HUD_PANEL_PRESSEDKEYS:
- HUD_Write_Cvar("hud_panel_pressedkeys_aspect");
- HUD_Write_Cvar("hud_panel_pressedkeys_attack");
- break;
- case HUD_PANEL_ENGINEINFO:
- HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time");
- HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals");
- break;
- case HUD_PANEL_INFOMESSAGES:
- HUD_Write_Cvar("hud_panel_infomessages_flip");
- break;
- case HUD_PANEL_PHYSICS:
- HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
- HUD_Write_Cvar("hud_panel_physics_speed_max");
- HUD_Write_Cvar("hud_panel_physics_speed_vertical");
- HUD_Write_Cvar("hud_panel_physics_topspeed");
- HUD_Write_Cvar("hud_panel_physics_topspeed_time");
- HUD_Write_Cvar("hud_panel_physics_acceleration_max");
- HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
- HUD_Write_Cvar("hud_panel_physics_flip");
- HUD_Write_Cvar("hud_panel_physics_baralign");
- HUD_Write_Cvar("hud_panel_physics_progressbar");
- HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
- HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
- HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
- HUD_Write_Cvar("hud_panel_physics_text");
- HUD_Write_Cvar("hud_panel_physics_text_scale");
- break;
- case HUD_PANEL_CENTERPRINT:
- HUD_Write_Cvar("hud_panel_centerprint_align");
- HUD_Write_Cvar("hud_panel_centerprint_flip");
- HUD_Write_Cvar("hud_panel_centerprint_fontscale");
- HUD_Write_Cvar("hud_panel_centerprint_fontscale_bold");
- HUD_Write_Cvar("hud_panel_centerprint_time");
- HUD_Write_Cvar("hud_panel_centerprint_fade_in");
- HUD_Write_Cvar("hud_panel_centerprint_fade_out");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha");
- HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize");
- HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize");
- break;
- case HUD_PANEL_ITEMSTIME:
- HUD_Write_Cvar("hud_panel_itemstime_iconalign");
- HUD_Write_Cvar("hud_panel_itemstime_progressbar");
- HUD_Write_Cvar("hud_panel_itemstime_progressbar_name");
- HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced");
- HUD_Write_Cvar("hud_panel_itemstime_text");
- HUD_Write_Cvar("hud_panel_itemstime_ratio");
- HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
- break;
- case HUD_PANEL_MAPVOTE:
- HUD_Write_Cvar("hud_panel_mapvote_highlight_border");
- break;
- case HUD_PANEL_QUICKMENU:
- HUD_Write_Cvar("hud_panel_quickmenu_align");
- break;
- case HUD_PANEL_SCOREBOARD:
- HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed");
- HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed");
- HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals");
- HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha");
- HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale");
- HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha");
- HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self");
- HUD_Write_Cvar("hud_panel_scoreboard_table_highlight");
- HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha");
- HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self");
- HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
- HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
- HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
- break;
- }
+ panel.panel_export(fh);
HUD_Write("\n");
}
- MUTATOR_CALLHOOK(HUD_WriteCvars, fh);
HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
void HUD_Panel_EnableMenu();
void HUD_Panel_FirstInDrawQ(float id);
+
+#define HUD_Write(s) fputs(fh, s)
+#define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
+#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
// Ammo (#1)
+void HUD_Ammo_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
+ HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
+ HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
+ HUD_Write_Cvar("hud_panel_ammo_iconalign");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
+ HUD_Write_Cvar("hud_panel_ammo_text");
+}
+
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
{
HUD_Panel_DrawProgressBar(
#include <client/miscfunctions.qh>
// CenterPrint (#16)
+
+void HUD_CenterPrint_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_centerprint_align");
+ HUD_Write_Cvar("hud_panel_centerprint_flip");
+ HUD_Write_Cvar("hud_panel_centerprint_fontscale");
+ HUD_Write_Cvar("hud_panel_centerprint_fontscale_bold");
+ HUD_Write_Cvar("hud_panel_centerprint_time");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_in");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_out");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize");
+ HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize");
+}
+
// These are the functions that draw the text at the center of the screen (e.g. frag messages and server MOTDs).
// Usually local_notification_centerprint_generic() is called, which in turn calls centerprint_generic(), which
// uses some kind of macro magic to call HUD_CenterPrint, which draws them on screen using drawcolorcodedstring().
// Chat (#12)
+void HUD_Chat_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
void HUD_Chat()
{
if(!autocvar__hud_configure)
// Engine info (#13)
+void HUD_EngineInfo_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time");
+ HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals");
+}
+
float prevfps;
float prevfps_time;
int framecounter;
// Health/armor (#3)
+void HUD_HealthArmor_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_healtharmor_combined");
+ HUD_Write_Cvar("hud_panel_healtharmor_flip");
+ HUD_Write_Cvar("hud_panel_healtharmor_iconalign");
+ HUD_Write_Cvar("hud_panel_healtharmor_baralign");
+ HUD_Write_Cvar("hud_panel_healtharmor_progressbar");
+ HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health");
+ HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor");
+ HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx");
+ HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth");
+ HUD_Write_Cvar("hud_panel_healtharmor_text");
+}
+
void HUD_HealthArmor()
{
int armor, health, fuel, air_time;
// Info messages (#14)
+void HUD_InfoMessages_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_infomessages_flip");
+}
+
float autocvar_hud_panel_infomessages_group0 = 1;
float autocvar_hud_panel_infomessages_group_fadetime = 0.4;
float autocvar_hud_panel_infomessages_group_time = 6;
// Mod icons (#10)
+void HUD_ModIcons_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_modicons_ca_layout");
+ HUD_Write_Cvar("hud_panel_modicons_dom_layout");
+ HUD_Write_Cvar("hud_panel_modicons_freezetag_layout");
+}
+
void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
{
TC(int, layout); TC(int, i);
// Notifications (#4)
+void HUD_Notify_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_notify_flip");
+ HUD_Write_Cvar("hud_panel_notify_fontsize");
+ HUD_Write_Cvar("hud_panel_notify_time");
+ HUD_Write_Cvar("hud_panel_notify_fadetime");
+ HUD_Write_Cvar("hud_panel_notify_icon_aspect");
+}
+
void HUD_Notify_Push(string icon, string attacker, string victim)
{
if (icon == "")
// Physics (#15)
+void HUD_Physics_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
+ HUD_Write_Cvar("hud_panel_physics_speed_max");
+ HUD_Write_Cvar("hud_panel_physics_speed_vertical");
+ HUD_Write_Cvar("hud_panel_physics_topspeed");
+ HUD_Write_Cvar("hud_panel_physics_topspeed_time");
+ HUD_Write_Cvar("hud_panel_physics_acceleration_max");
+ HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
+ HUD_Write_Cvar("hud_panel_physics_flip");
+ HUD_Write_Cvar("hud_panel_physics_baralign");
+ HUD_Write_Cvar("hud_panel_physics_progressbar");
+ HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
+ HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
+ HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
+ HUD_Write_Cvar("hud_panel_physics_text");
+ HUD_Write_Cvar("hud_panel_physics_text_scale");
+}
+
vector acc_prevspeed;
float acc_prevtime, acc_avg, top_speed, top_speed_time;
float physics_update_time, discrete_speed, discrete_acceleration;
// Powerups (#2)
+void HUD_Powerups_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_powerups_iconalign");
+ HUD_Write_Cvar("hud_panel_powerups_baralign");
+ HUD_Write_Cvar("hud_panel_powerups_progressbar");
+ HUD_Write_Cvar("hud_panel_powerups_text");
+}
+
// Powerup item fields (reusing existing fields)
.string message; // Human readable name
.string netname; // Icon name
// Pressed keys (#11)
+void HUD_PressedKeys_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_pressedkeys_aspect");
+ HUD_Write_Cvar("hud_panel_pressedkeys_attack");
+}
+
void HUD_PressedKeys()
{
if(!autocvar__hud_configure)
// QuickMenu (#23)
+void HUD_QuickMenu_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_quickmenu_align");
+}
+
// QUICKMENU_MAXLINES must be <= 10
const int QUICKMENU_MAXLINES = 10;
// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
#include <client/miscfunctions.qh>
#include <common/mapinfo.qh>
-// Race timer (#6)
+// Race timer (#8)
+
+void HUD_RaceTimer_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
// return the string of the onscreen race timer
string MakeRaceString(int cp, float mytime, float theirtime, float othertime, float lapdelta, string theirname)
// Radar (#6)
+void HUD_Radar_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
+ HUD_Write_Cvar("hud_panel_radar_rotation");
+ HUD_Write_Cvar("hud_panel_radar_zoommode");
+ HUD_Write_Cvar("hud_panel_radar_scale");
+ HUD_Write_Cvar("hud_panel_radar_maximized_scale");
+ HUD_Write_Cvar("hud_panel_radar_maximized_size");
+ HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
+ HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
+}
+
bool HUD_Radar_Clickable()
{
return hud_panel_radar_mouse && !hud_panel_radar_temp_hidden;
// Score (#7)
+void HUD_Score_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_score_rankings");
+}
+
void HUD_Score_Rankings(vector pos, vector mySize, entity me)
{
float score;
// Scoreboard (#24)
+void Scoreboard_Draw_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed");
+ HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed");
+ HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_highlight");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha");
+ HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self");
+ HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
+ HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
+ HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
+}
+
const int MAX_SBT_FIELDS = MAX_SCORE;
PlayerScoreField sbt_field[MAX_SBT_FIELDS + 1];
// Timer (#5)
+void HUD_Timer_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
void HUD_Timer()
{
if(!autocvar__hud_configure)
// Vote (#9)
+void HUD_Vote_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha");
+}
+
void HUD_Vote()
{
if(autocvar_cl_allow_uid2name == -1 && (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (serverflags & SERVERFLAG_PLAYERSTATS)))
// Weapons (#0)
+void HUD_Weapons_Export(int fh)
+{
+ HUD_Write_Cvar("hud_panel_weapons_accuracy");
+ HUD_Write_Cvar("hud_panel_weapons_label");
+ HUD_Write_Cvar("hud_panel_weapons_label_scale");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_time");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave");
+ HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable");
+ HUD_Write_Cvar("hud_panel_weapons_ammo");
+ HUD_Write_Cvar("hud_panel_weapons_ammo_color");
+ HUD_Write_Cvar("hud_panel_weapons_ammo_alpha");
+ HUD_Write_Cvar("hud_panel_weapons_aspect");
+ HUD_Write_Cvar("hud_panel_weapons_timeout");
+ HUD_Write_Cvar("hud_panel_weapons_timeout_effect");
+ HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin");
+ HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin");
+ HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
+ HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
+ HUD_Write_Cvar("hud_panel_weapons_onlyowned");
+ HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
+ HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
+ HUD_Write_Cvar("hud_panel_weapons_selection_radius");
+ HUD_Write_Cvar("hud_panel_weapons_selection_speed");
+}
+
entity weaponorder[Weapons_MAX];
void weaponorder_swap(int i, int j, entity pass)
{
registercvar("cl_multijump", "-1");
+ registercvar("cl_dodging", "0");
+
registercvar("cl_spawn_near_teammate", "1");
registercvar("cl_weapon_switch_reload", "1");
#include <common/mapinfo.qh>
+// MapVote (#21)
+
+void MapVote_Draw_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_mapvote_highlight_border");
+}
int mv_num_maps;
/**/
MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages);
-/** Called when drawing info messages, allows adding new info messages */
-#define EV_HUD_WriteCvars(i, o) \
- /** file */ i(float, MUTATOR_ARGV_0_float) \
- /**/
-MUTATOR_HOOKABLE(HUD_WriteCvars, EV_HUD_WriteCvars);
-
/** Called when the view model is being animated (setorigin is called after the hook, so you only need to modify origin here if desired) */
#define EV_DrawViewModel(i, o) \
/** entity id */ i(entity, MUTATOR_ARGV_0_entity) \
//UNSET_ONGROUND(this);
}
- Movetype_Physics_MatchTicrate(this, autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
- if (wasfreed(this))
- return; // deleted by touch function
-
this.renderflags = 0;
this.alpha = bound(0, this.cnt - time, 1);
{
Casing_Delete(this);
this.drawmask = 0;
+ return;
}
+
+ Movetype_Physics_MatchTicrate(this, autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
+ //if (wasfreed(this))
+ // return; // deleted by touch function
}
SOUND(BRASS1, W_Sound("brass1"));
MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor)
{
+ if (time < game_starttime || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
+ return;
+
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
float frag_damage = M_ARGV(7, float);
}
else
{
- for (;;)
+ while((s = fgets(fh)))
{
- if (!((s = fgets(fh))))
- break;
-
// catch different sorts of comments
if(s == "") // empty lines
continue;
#ifdef SVQC
if(IS_PLAYER(player))
{
- if(tflags & TELEPORT_FLAG_TDEATH)
- if(player.takedamage && !IS_DEAD(player) && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
- tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
+ if((tflags & TELEPORT_FLAG_TDEATH) && player.takedamage && !IS_DEAD(player)
+ && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH))
+ && !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
+ {
+ tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
+ }
// player no longer is on ground
UNSET_ONGROUND(player);
#include <client/hud/hud_config.qh>
#include <client/mapvoting.qh>
+void HUD_MinigameBoard_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameStatus_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameHelp_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameMenu_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
// whether the mouse is over the given panel
bool HUD_mouse_over(entity somepanel)
{
{
case "ammoregen": return "ammo";
case "haste": case "scout": return "speed";
- case "guard": case "revival": case "regen": return "medic";
+ case "guard": return "resistance";
+ case "revival": case "regen": return "medic";
case "invis": return "invisible";
case "jumper": return "jump";
default: return buffname;
this.m_color = '0.36 1 0.07';
}
BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(guard, BUFF_RESISTANCE)
REGISTER_BUFF(SPEED) {
this.m_name = _("Speed");
this.m_color = '1 0.12 0';
}
BUFF_SPAWNFUNCS(medic, BUFF_MEDIC)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(guard, BUFF_MEDIC)
BUFF_SPAWNFUNC_Q3TA_COMPAT(regen, BUFF_MEDIC)
BUFF_SPAWNFUNC_Q3TA_COMPAT(revival, BUFF_MEDIC)
if (!this.dodging_action) return;
// when swimming or dead, no dodging allowed..
- if (this.waterlevel >= WATERLEVEL_SWIMMING || IS_DEAD(this) || (PHYS_DODGING_CLIENTSELECT && !PHYS_DODGING_ENABLED(this)))
+ bool frozen_dodging = (PHYS_FROZEN(this) && PHYS_DODGING_FROZEN(this));
+ if (this.waterlevel >= WATERLEVEL_SWIMMING || IS_DEAD(this) || (PHYS_DODGING_CLIENTSELECT && !PHYS_DODGING_ENABLED(this) && !frozen_dodging))
{
this.dodging_action = 0;
this.dodging_direction.x = 0;
#ifdef CSQC
+// ItemsTime (#22)
+
+void HUD_ItemsTime_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_itemstime_iconalign");
+ HUD_Write_Cvar("hud_panel_itemstime_progressbar");
+ HUD_Write_Cvar("hud_panel_itemstime_progressbar_name");
+ HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced");
+ HUD_Write_Cvar("hud_panel_itemstime_text");
+ HUD_Write_Cvar("hud_panel_itemstime_ratio");
+ HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
+}
+
void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, float item_time, bool item_available, float item_availableTime)
{
float t = 0;
#include "nades.qh"
#include "../overkill/okmachinegun.qh"
+#include "../overkill/okshotgun.qh"
#ifdef SVQC
bool autocvar_g_nades_nade_small;
void nade_monster_boom(entity this)
{
- entity e = spawnmonster(spawn(), this.pokenade_type, 0, this.realowner, this.realowner, this.origin, false, false, 1);
+ entity e = spawn();
+ e.noalign = true; // don't drop to floor
+ e = spawnmonster(e, this.pokenade_type, 0, this.realowner, this.realowner, this.origin, false, false, 1);
if(autocvar_g_nades_pokenade_monster_lifetime > 0)
e.monster_lifetime = time + autocvar_g_nades_pokenade_monster_lifetime;
}
else if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN) || DEATH_ISWEAPON(deathtype, WEP_OVERKILL_MACHINEGUN))
damage = this.max_health * 0.1;
- else if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO
+ else if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) || DEATH_ISWEAPON(deathtype, WEP_OVERKILL_SHOTGUN)) // WEAPONTODO
{
if(!(deathtype & HITTYPE_SECONDARY))
damage = this.max_health * 1.15;
float dt = time - this.move_time;
- int n = max(0, floor(dt / tr));
+ int n = bound(0, floor(dt / tr), 32); // limit the number of frames to 32 (CL_MAX_USERCMDS, using DP_SMALLMEMORY value for consideration of QC's limitations)
dt -= n * tr;
this.move_time += n * tr;
setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
}
}
-#ifdef CSQC
- if (IS_ONGROUND(this) || this.velocity.z <= 0 || PHYS_WATERJUMP_TIME(this) <= 0)
- PHYS_WATERJUMP_TIME(this) = 0;
-#endif
+ _Movetype_CheckWater(this); // needs to be run on the client, might as well use the latest on the server too!
}
void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
this.velocity_z = 225;
this.flags |= FL_WATERJUMP;
SET_JUMP_HELD(this);
- #ifdef SVQC
- PHYS_TELEPORT_TIME(this) = time + 2; // safety net
- #elif defined(CSQC)
- PHYS_WATERJUMP_TIME(this) = 2;
- #endif
}
}
}
{
if (!PHYS_FROZEN(this))
return;
- if (PHYS_DODGING_FROZEN(this)
-#ifdef SVQC
- && IS_REAL_CLIENT(this)
-#endif
- )
+ if (PHYS_DODGING_FROZEN(this) && IS_CLIENT(this))
{
- PHYS_CS(this).movement_x = bound(-5, PHYS_CS(this).movement.x, 5);
- PHYS_CS(this).movement_y = bound(-5, PHYS_CS(this).movement.y, 5);
- PHYS_CS(this).movement_z = bound(-5, PHYS_CS(this).movement.z, 5);
+ // bind movement to a very slow speed so dodging can use .movement for directional calculations
+ PHYS_CS(this).movement_x = bound(-2, PHYS_CS(this).movement.x, 2);
+ PHYS_CS(this).movement_y = bound(-2, PHYS_CS(this).movement.y, 2);
+ PHYS_CS(this).movement_z = bound(-2, PHYS_CS(this).movement.z, 2);
}
else
PHYS_CS(this).movement = '0 0 0';
-
- vector midpoint = ((this.absmin + this.absmax) * 0.5);
- if (pointcontents(midpoint) == CONTENT_WATER)
- {
- this.velocity = this.velocity * 0.5;
-
- if (pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
- this.velocity_z = 200;
- }
}
void PM_check_hitground(entity this)
#define ITEMS_STAT(s) ((s).items)
.float teleport_time;
-#define PHYS_TELEPORT_TIME(s) ((s).teleport_time)
-
-.float waterjump_time;
-#define PHYS_WATERJUMP_TIME(s) ((s).waterjump_time)
#ifdef CSQC
void sys_phys_fix(entity this, float dt)
{
this.team = myteam + 1; // is this correct?
- PHYS_WATERJUMP_TIME(this) -= dt;
this.movement = PHYS_INPUT_MOVEVALUES(this);
this.items = STAT(ITEMS, this);
if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
if (this.flags & FL_WATERJUMP) {
this.velocity_x = this.movedir.x;
this.velocity_y = this.movedir.y;
- if (this.waterlevel == WATERLEVEL_NONE
- || time > PHYS_TELEPORT_TIME(this)
- || PHYS_WATERJUMP_TIME(this) <= 0
- ) {
+ if (this.waterlevel == WATERLEVEL_NONE) {
this.flags &= ~FL_WATERJUMP;
- PHYS_TELEPORT_TIME(this) = 0;
- PHYS_WATERJUMP_TIME(this) = 0;
}
} else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt)) {
// handled
if (this.com_phys_water) {
// water jump only in certain situations
// this mimics quakeworld code
- if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) {
+ if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc && !PHYS_FROZEN(this)) {
vector yawangles = '0 1 0' * this.v_angle.y;
vector forward, right, up;
MAKE_VECTORS(yawangles, forward, right, up);
+ right * PHYS_CS(this).movement.y
+ '0 0 1' * PHYS_CS(this).movement.z * (this.com_phys_vel_2d ? 0 : 1);
if (this.com_phys_water) {
- if (PHYS_INPUT_BUTTON_CROUCH(this)) {
- wishvel.z = -PHYS_MAXSPEED(this);
+ if (PHYS_FROZEN(this))
+ {
+ if(this.waterlevel >= WATERLEVEL_SUBMERGED && this.velocity.z >= -70) // don't change the speed too abruptally
+ wishvel = '0 0 160'; // resurface
+ else if(this.waterlevel >= WATERLEVEL_SWIMMING && this.velocity.z > 0)
+ wishvel = eZ * 1.3 * min(this.velocity.z, 160); // resurface a bit more above the surface
}
- if (this.viewloc) {
- wishvel.z = -160; // drift anyway
- } else if (wishvel == '0 0 0') {
- wishvel = '0 0 -60'; // drift towards bottom
+ else
+ {
+ if (PHYS_INPUT_BUTTON_CROUCH(this)) {
+ wishvel.z = -PHYS_MAXSPEED(this);
+ }
+ if (this.viewloc) {
+ wishvel.z = -160; // drift anyway
+ } else if (wishvel == '0 0 0') {
+ wishvel = '0 0 -60'; // drift towards bottom
+ }
}
}
if (this.com_phys_ladder) {
float wishspeed = min(vlen(wishvel), this.com_phys_vel_max);
if (this.com_phys_air) {
- if ((IS_SVQC && time >= PHYS_TELEPORT_TIME(this))
- || (IS_CSQC && PHYS_WATERJUMP_TIME(this) <= 0)) {
+ if (!(this.flags & FL_WATERJUMP)) {
// apply air speed limit
float airaccelqw = PHYS_AIRACCEL_QW(this);
float wishspeed0 = wishspeed;
if (this.com_phys_water) {
wishspeed *= 0.7;
- // if (PHYS_WATERJUMP_TIME(this) <= 0) // TODO: use
+ // if (!(this.flags & FL_WATERJUMP)) // TODO: use
{
// water friction
float f = 1 - dt * PHYS_FRICTION(this);
}
// holding jump button swims upward slowly
- if (this.com_in_jump && !this.viewloc) {
+ if (this.com_in_jump && !this.viewloc && !PHYS_FROZEN(this)) {
// was:
// lava: 50
// slime: 80
return;
}
- if (IS_CSQC ? PHYS_WATERJUMP_TIME(this) <= 0 : time >= PHYS_TELEPORT_TIME(this)) {
+ if (!(this.flags & FL_WATERJUMP)) {
PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0);
}
}
{
if(!autocvar_cl_movement) { return; }
- _Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
+ //_Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
vector oldv_angle = this.v_angle;
vector oldangles = this.angles; // we need to save these, as they're abused by other code
FIELD_SCALAR(fld, health) \
FIELD_SCALAR(fld, height) \
FIELD_SCALAR(fld, impulse) \
+ FIELD_SCALAR(fld, invincible_finished) \
FIELD_SCALAR(fld, item_pickupsound) \
FIELD_SCALAR(fld, killtarget) \
FIELD_SCALAR(fld, lerpfrac) \
FIELD_SCALAR(fld, phase) \
FIELD_SCALAR(fld, platmovetype) \
FIELD_SCALAR(fld, race_place) \
+ FIELD_SCALAR(fld, strength_finished) \
FIELD_SCALAR(fld, radius) \
FIELD_SCALAR(fld, respawntimestart) \
FIELD_SCALAR(fld, respawntimejitter) \
}
else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); }
- me.connectButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+ me.connectButton.disabled = (me.ipAddressBox.text == "");
//me.disconnectButton.disabled = (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)));
- me.infoButton.disabled = (me.lockedSelectedItem || me.nItems == 0 || !owned);
- me.favoriteButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+ me.infoButton.disabled = !owned;
+ me.favoriteButton.disabled = (me.ipAddressBox.text == "");
bool found = false;
if(me.lockedSelectedItem)
}
void ServerList_Connect_Click(entity btn, entity me)
{
- if (me.lockedSelectedItem)
- return;
- string sv = (me.ipAddressBox.text != "") ? me.ipAddressBox.text : me.selectedServer;
- localcmd(sprintf("connect %s\n", sv));
+ if (me.ipAddressBox.text != "")
+ localcmd(sprintf("connect %s\n", me.ipAddressBox.text));
}
void ServerList_Favorite_Click(entity btn, entity this)
{
bool autocvar_g_maplist_votable_suggestions_override_mostrecent;
float autocvar_g_maplist_votable_timeout;
bool autocvar_g_maplist_ignore_sizes;
+bool autocvar_g_maplist_sizes_count_maxplayers = true;
bool autocvar_g_maplist_sizes_count_bots = true;
int autocvar_g_maxplayers;
float autocvar_g_maxplayers_spectator_blocktime;
{
string arg = argv(j);
if(arg == "") continue;
- _MapInfo_Parse_Settemp(mapname, MAPINFO_SETTEMP_ACL_USER, 0, arg, 0); // no recursion!
+ _MapInfo_Parse_Settemp(mapname, MAPINFO_SETTEMP_ACL_USER, 0, arg, 1);
}
}
#endif
int GetPlayerLimit()
{
+ if(g_duel)
+ return 2; // TODO: this workaround is needed since the mutator hook from duel can't be activated before the gametype is loaded (e.g. switching modes via gametype vote screen)
int player_limit = autocvar_g_maxplayers;
MUTATOR_CALLHOOK(GetPlayerLimit, player_limit);
player_limit = M_ARGV(0, int);
BADCVAR("g_ctf_flag_glowtrails");
BADCVAR("g_ctf_dynamiclights");
BADCVAR("g_ctf_flag_pickup_verbosename");
+ BADPRESUFFIX("g_ctf_flag_", "_model");
+ BADPRESUFFIX("g_ctf_flag_", "_skin");
BADCVAR("g_domination_point_leadlimit");
BADCVAR("g_forced_respawn");
BADCVAR("g_freezetag_point_leadlimit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("leadlimit_override");
BADCVAR("pausable");
+ BADCVAR("sv_announcer");
BADCVAR("sv_checkforpacketsduringsleep");
BADCVAR("sv_damagetext");
BADCVAR("sv_db_saveasdump");
// open map size restriction file
string opensize_msg = strcat("opensize ", map);
float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
- int pcount = player_count;
+ int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
+ int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
if(!autocvar_g_maplist_sizes_count_bots)
pcount -= currentbots;
if(fh >= 0)
void Map_MarkAsRecent(string m)
{
- cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
+ cvar_set("g_maplist_mostrecent", strwords(cons(m, autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
}
float Map_IsRecent(string m)
if(!gametypevote || gametypevote_finished)
return false;
+ localcmd("sv_vote_gametype_hook_all\n");
+ localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n");
+
if ( !GameTypeVote_SetGametype(GameTypeVote_Type_FromString(mapvote_maps[pos])) )
{
LOG_TRACE("Selected gametype is not supported by any map");
}
- localcmd("sv_vote_gametype_hook_all\n");
- localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n");
-
gametypevote_finished = true;
return true;
// race only (middle of the race)
g_race_qualifying = false;
pl_race_place = 0;
- if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) {
+ if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) {
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for respawning in race) - bailing out"));
}
// qualifying only
g_race_qualifying = 1;
pl_race_place = race_lowest_place_spawn;
- if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) {
+ if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) {
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out"));
}
g_race_qualifying = 0;
for (int p = 1; p <= race_highest_place_spawn; ++p) {
pl_race_place = p;
- if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) {
+ if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) {
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for initially spawning in race) - bailing out"));
}
}
pl_race_checkpoint = race_NextCheckpoint(0);
g_race_qualifying = 1;
pl_race_place = race_lowest_place_spawn;
- if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) {
+ if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) {
error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out"));
}
} else {
{
entity s;
- if(game_stopped || time < game_starttime
- || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
+ if(game_stopped)
{
score = 0;
}
bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
score = M_ARGV(1, float);
- if((!mutator_returnvalue && game_stopped) || time < game_starttime
- || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
+ if(!mutator_returnvalue && game_stopped)
{
score = 0;
}
{
this.team = actor.team;
some_spawn_has_been_used = true;
+ this.SendFlags |= 1; // update team on the client side
}
//LOG_INFO("spawnpoint was used!\n");
}
+void spawnpoint_reset(entity this)
+{
+ this.SendFlags |= 1; // update team since it was restored during reset
+}
+
void relocate_spawnpoint(entity this)
{
// nudge off the floor
this.use = spawnpoint_use;
setthink(this, spawnpoint_think);
this.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
+ this.reset2 = spawnpoint_reset; // restores team, allows re-sending the spawnpoint
this.team_saved = this.team;
IL_PUSH(g_saved_team, this);
if (!this.cnt)
// Returns:
// _x: prio (-1 if unusable)
// _y: weight
-vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
+vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
{
// filter out spots for the wrong team
if(teamcheck >= 0)
return '-1 0 0';
if(race_spawns)
- if(spot.target == "")
+ if(!spot.target || spot.target == "")
return '-1 0 0';
if(IS_REAL_CLIENT(this))
vector spawn_score = prio * '1 0 0' + shortest * '0 1 0';
// filter out spots for assault
- if(spot.target && spot.target != "")
+ if(spot.target && spot.target != "" && targetcheck)
{
int found = 0;
for(entity targ = findchain(targetname, spot.target); targ; targ = targ.chain)
return spawn_score;
}
-void Spawn_ScoreAll(entity this, entity firstspot, float mindist, float teamcheck)
+void Spawn_ScoreAll(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
{
entity spot;
for(spot = firstspot; spot; spot = spot.chain)
- spot.spawnpoint_score = Spawn_Score(this, spot, mindist, teamcheck);
+ spot.spawnpoint_score = Spawn_Score(this, spot, mindist, teamcheck, targetcheck);
}
-entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck)
+entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
{
entity spot, spotlist, spotlistend;
spotlist = NULL;
spotlistend = NULL;
- Spawn_ScoreAll(this, firstspot, mindist, teamcheck);
+ Spawn_ScoreAll(this, firstspot, mindist, teamcheck, targetcheck);
for(spot = firstspot; spot; spot = spot.chain)
{
}
else
{
- firstspot = Spawn_FilterOutBadSpots(this, firstspot, 100, teamcheck);
+ firstspot = Spawn_FilterOutBadSpots(this, firstspot, 100, teamcheck, true);
+
+ // emergency fallback! double check without targets
+ // fixes some crashes with improperly repacked maps
+ if(!firstspot)
+ {
+ firstspot = IL_FIRST(g_spawnpoints);
+ prev = NULL;
+ IL_EACH(g_spawnpoints, true,
+ {
+ if(prev)
+ prev.chain = it;
+ it.chain = NULL;
+ prev = it;
+ });
+ firstspot = Spawn_FilterOutBadSpots(this, firstspot, 100, teamcheck, false);
+ }
// there is 50/50 chance of choosing a random spot or the furthest spot
// (this means that roughly every other spawn will be furthest, so you
.vector spawnpoint_score;
float spawnpoint_nag;
bool SpawnEvent_Send(entity this, entity to, int sf);
-entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck);
+entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck);
entity SelectSpawnPoint(entity this, bool anypoint);
spawnfunc(info_player_deathmatch);
void spawnpoint_use(entity this, entity actor, entity trigger);
g_forced_respawn 1
// g_playerclip_collisions 0 // do not check playerclips
g_powerups 0
-g_spawnpoints_auto_move_out_of_solid 1
g_start_delay 3
g_use_ammunition 0
g_weapon_stay 1
echo
-echo You have not written any server.cfg file yet.
-echo The server will therefore run at default settings.
+echo ^1You have started a dedicated server but have not created
+echo ^1any server.cfg in your config directory.
echo
-echo For information on how to set up a dedicated server,
-echo look at the files in the server/ subdirectory of your
-echo Xonotic install.
+echo ^1If you are seeing this when just trying to play Xonotic
+echo ^1(not host a server), try the other executables.
echo
+echo ^1For information on how to set up a dedicated server,
+echo ^1look at the files in the server/ subdirectory of your
+echo ^1Xonotic install.
+echo
+echo ^1Quitting in 5 seconds.
+echo
+
+// see https://gitlab.com/xonotic/xonotic/issues/184
+defer 5 quit
seta cl_damageeffect_lifetime_min 3 "minimum lifetime a damage effect may have"
seta cl_damageeffect_lifetime_max 6 "maximum lifetime a damage effect may have"
-set cl_deathglow 0.8 "number of seconds during which dead bodies glow out"
+set cl_deathglow 2 "number of seconds during which dead bodies glow out"
+set cl_deathglow_min 0.5 "glow out up to this glow factor"
cl_movement 1
cl_movement_track_canjump 0
set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\", \"most\", \"all_available\" or \"most_available\" (available only gives the weapon if the map normally has it as a pickup item)"
set g_weaponarena_random "0" "if set to a number, only that weapon count is given on every spawn (randomly)"
set g_weaponarena_random_with_blaster "1" "additionally, always provide the blaster in random weapon arena games"
-set g_spawnpoints_auto_move_out_of_solid 0 "if set to 1 you will see a warning if a spawn point was placed inside a solid"
+set g_spawnpoints_auto_move_out_of_solid 1 "show a warning if a spawn point was placed inside a solid, disabling this setting causes such spawn points to be removed and produce a more verbose error message"
set g_forced_respawn 0 "if set to 1 and a player died, that player gets automatically respawned once <g_respawn_delay> seconds are over"
set g_fullbrightplayers 0 "brightens up player models (note that the color, skin or model of the players does not change!)"
set g_fullbrightitems 0 "disables lighting effects on items, making them appear bright for visibility"
set g_maplist_shuffle 1 "new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list"
set g_maplist_check_waypoints 0 "when 1, maps are skipped if there currently are bots, but the map has no waypoints"
set g_maplist_ignore_sizes 0 "when 1, all maps are shown in the map list regardless of player count"
+set g_maplist_sizes_count_maxplayers 1 "check the player limit when getting the player count so forced spectators don't affect the size restrictions"
set g_maplist_sizes_count_bots 1 "include the number of bots currently in the server when counting the number of players for size restrictions"
set g_items_mindist 4000 "starting distance for the fading of items"