Commit 9462b11f authored by Marios Fanourakis's avatar Marios Fanourakis
Browse files

updated base source files from xonotic official repository

parent 932f7885
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
To use this logging system just replace the original qcsrc folder in: To use this logging system just replace the original qcsrc folder in:
xonotic\data\xonotic-data.pk3dir\qcsrc with the one in this repository. xonotic\data\xonotic-data.pk3dir\qcsrc with the one in this repository.
To enable the event logging, edit the file data/xonotic-data.pk3dir/xonotic-server.cfg as follows:
set sv_eventlog 1
qcsrc/server/miscfunctions.qc contains support for LSL, it is commented out by default
# Code Reference For Parsing # Code Reference For Parsing
This is a reference for the logging codes we obtain from Xonotic just to make sure once analysing the markers everything is correct. This is a reference for the logging codes we obtain from Xonotic just to make sure once analysing the markers everything is correct.
...@@ -106,4 +111,21 @@ Example ...@@ -106,4 +111,21 @@ Example
3 = Shotgun Ammo 3 = Shotgun Ammo
4 = Machine Gun Ammo 4 = Machine Gun Ammo
5 = Mortar / Devastator Ammo 5 = Mortar / Devastator Ammo
6 = Electro / Crylink / Vortex (Sniper) Ammo 6 = Electro / Crylink / Vortex (Sniper) Ammo
\ No newline at end of file
# Notes
This code has been edited from https://gitlab.com/xonotic/xonotic-data.pk3dir repository at revision `d4bf1b512a56e647007f5a35d68613b5b1121dd3`.
Below are the changes made by UniGe:
Modified files:
server/client.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/resources.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/weaponsystem.qc
New files:
qcsrc/server/liblsl64.dll
qcsrc/server/lsl_c.qh
\ No newline at end of file
/html/ /html/
/*.pk3 /*.pk3
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
...@@ -93,8 +93,8 @@ pk3: csprogs-$(VER).pk3 ...@@ -93,8 +93,8 @@ pk3: csprogs-$(VER).pk3
$(eval DAT=$(PROG)-$(VER).dat) $(eval DAT=$(PROG)-$(VER).dat)
$(eval LNO=$(PROG)-$(VER).lno) $(eval LNO=$(PROG)-$(VER).lno)
@ echo "http://xonotic.org" > $(TXT) @ echo "http://xonotic.org" > $(TXT)
@ ln -f $(PROGS_OUT)/$(PROG).dat $(DAT) @ cp -f $(PROGS_OUT)/$(PROG).dat $(DAT)
@ ln -f $(PROGS_OUT)/$(PROG).lno $(LNO) @ cp -f $(PROGS_OUT)/$(PROG).lno $(LNO)
@ $(RM) *.pk3 @ $(RM) *.pk3
$(ZIP) $(PK3) $(TXT) $(DAT) $(LNO) $(ZIP) $(PK3) $(TXT) $(DAT) $(LNO)
@ $(RM) $(TXT) $(DAT) $(LNO) @ $(RM) $(TXT) $(DAT) $(LNO)
......
...@@ -115,7 +115,7 @@ void Announcer_Gamestart() ...@@ -115,7 +115,7 @@ void Announcer_Gamestart()
previous_game_starttime = startTime; previous_game_starttime = startTime;
} }
#define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN { \ #define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN \
if(announcer_##minute##min) { \ if(announcer_##minute##min) { \
if(timeleft > minute * 60) \ if(timeleft > minute * 60) \
announcer_##minute##min = false; \ announcer_##minute##min = false; \
...@@ -125,7 +125,7 @@ void Announcer_Gamestart() ...@@ -125,7 +125,7 @@ void Announcer_Gamestart()
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_##minute); \ Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_##minute); \
} \ } \
} \ } \
} MACRO_END MACRO_END
void Announcer_Time() void Announcer_Time()
{ {
......
...@@ -25,7 +25,6 @@ float autocvar_cl_announcer_antispam = 2; ...@@ -25,7 +25,6 @@ float autocvar_cl_announcer_antispam = 2;
float autocvar_cl_announcer_maptime = 3; float autocvar_cl_announcer_maptime = 3;
bool autocvar_cl_autodemo_delete; bool autocvar_cl_autodemo_delete;
bool autocvar_cl_autodemo_delete_keeprecords; bool autocvar_cl_autodemo_delete_keeprecords;
bool autocvar_cl_casings;
float autocvar_cl_casings_bronze_time; float autocvar_cl_casings_bronze_time;
int autocvar_cl_casings_maxcount = 100; int autocvar_cl_casings_maxcount = 100;
float autocvar_cl_casings_shell_time; float autocvar_cl_casings_shell_time;
...@@ -39,13 +38,13 @@ float autocvar_cl_effects_lightningarc_drift_end; ...@@ -39,13 +38,13 @@ float autocvar_cl_effects_lightningarc_drift_end;
float autocvar_cl_effects_lightningarc_drift_start; float autocvar_cl_effects_lightningarc_drift_start;
float autocvar_cl_effects_lightningarc_segmentlength; float autocvar_cl_effects_lightningarc_segmentlength;
bool autocvar_cl_effects_lightningarc_simple; bool autocvar_cl_effects_lightningarc_simple;
int autocvar_cl_gentle; bool autocvar_cl_gentle;
int autocvar_cl_gentle_damage; int autocvar_cl_gentle_damage;
int autocvar_cl_gentle_gibs; int autocvar_cl_gentle_gibs;
int autocvar_cl_gentle_messages; int autocvar_cl_gentle_messages;
float autocvar_cl_gibs_damageforcescale = 3.5; float autocvar_cl_gibs_damageforcescale = 3.5;
float autocvar_cl_gibs_lifetime = 14; float autocvar_cl_gibs_lifetime = 14;
float autocvar_cl_gibs_maxcount = 100; int autocvar_cl_gibs_maxcount = 100;
bool autocvar_cl_gibs_sloppy = 1; bool autocvar_cl_gibs_sloppy = 1;
float autocvar_cl_gibs_ticrate = 0.1; float autocvar_cl_gibs_ticrate = 0.1;
float autocvar_cl_gibs_velocity_random = 1; float autocvar_cl_gibs_velocity_random = 1;
...@@ -71,13 +70,13 @@ bool autocvar_cl_spawn_event_particles; ...@@ -71,13 +70,13 @@ bool autocvar_cl_spawn_event_particles;
bool autocvar_cl_spawn_event_sound = 1; bool autocvar_cl_spawn_event_sound = 1;
// float autocvar_cl_spawn_point_model; // float autocvar_cl_spawn_point_model;
bool autocvar_cl_spawn_point_particles; bool autocvar_cl_spawn_point_particles;
float autocvar_cl_spawn_point_dist_min = 1200; float autocvar_cl_spawn_point_dist_min = 800;
float autocvar_cl_spawn_point_dist_max = 1600; float autocvar_cl_spawn_point_dist_max = 1200;
bool autocvar_cl_spawnzoom = 1; bool autocvar_cl_spawnzoom = 1;
float autocvar_cl_spawnzoom_speed = 1; float autocvar_cl_spawnzoom_speed = 1;
float autocvar_cl_spawnzoom_factor = 2; float autocvar_cl_spawnzoom_factor = 2;
bool autocvar_cl_stripcolorcodes; bool autocvar_cl_stripcolorcodes;
bool autocvar_cl_vehicles_alarm = true; bool autocvar_cl_vehicles_alarm = false;
bool autocvar_cl_vehicles_hud_tactical = true; bool autocvar_cl_vehicles_hud_tactical = true;
float autocvar_cl_vehicles_hudscale = 0.5; float autocvar_cl_vehicles_hudscale = 0.5;
float autocvar_cl_vehicles_notify_time = 15; float autocvar_cl_vehicles_notify_time = 15;
...@@ -151,6 +150,8 @@ bool autocvar_crosshair_ring_reload; ...@@ -151,6 +150,8 @@ bool autocvar_crosshair_ring_reload;
float autocvar_crosshair_ring_reload_alpha; float autocvar_crosshair_ring_reload_alpha;
float autocvar_crosshair_ring_reload_size; float autocvar_crosshair_ring_reload_size;
float autocvar_crosshair_size; float autocvar_crosshair_size;
bool autocvar_crosshair_chase = true;
float crosshair_chase_playeralpha = 0.25;
int autocvar_ekg; int autocvar_ekg;
float autocvar_fov; float autocvar_fov;
bool autocvar_hud_cursormode = true; bool autocvar_hud_cursormode = true;
...@@ -268,7 +269,6 @@ bool autocvar_hud_panel_infomessages_flip; ...@@ -268,7 +269,6 @@ bool autocvar_hud_panel_infomessages_flip;
float autocvar_hud_panel_mapvote_highlight_border = 1; float autocvar_hud_panel_mapvote_highlight_border = 1;
bool autocvar_hud_panel_modicons; bool autocvar_hud_panel_modicons;
int autocvar_hud_panel_modicons_ca_layout; int autocvar_hud_panel_modicons_ca_layout;
int autocvar_hud_panel_modicons_dom_layout;
int autocvar_hud_panel_modicons_freezetag_layout; int autocvar_hud_panel_modicons_freezetag_layout;
bool autocvar_hud_panel_notify; bool autocvar_hud_panel_notify;
float autocvar_hud_panel_notify_fadetime; float autocvar_hud_panel_notify_fadetime;
...@@ -351,6 +351,7 @@ float autocvar_hud_panel_weapons_selection_radius = 0; ...@@ -351,6 +351,7 @@ float autocvar_hud_panel_weapons_selection_radius = 0;
float autocvar_hud_panel_weapons_selection_speed = 10; float autocvar_hud_panel_weapons_selection_speed = 10;
float autocvar_hud_panel_weapons_timeout; float autocvar_hud_panel_weapons_timeout;
int autocvar_hud_panel_weapons_timeout_effect; int autocvar_hud_panel_weapons_timeout_effect;
bool autocvar_hud_panel_weapons_orderbyimpulse = true;
float autocvar_hud_panel_weapons_timeout_fadebgmin; float autocvar_hud_panel_weapons_timeout_fadebgmin;
float autocvar_hud_panel_weapons_timeout_fadefgmin; float autocvar_hud_panel_weapons_timeout_fadefgmin;
float autocvar_hud_panel_weapons_timeout_speed_in = 0.25; float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
...@@ -381,6 +382,7 @@ float autocvar_hud_shownames_crosshairdistance_antioverlap; ...@@ -381,6 +382,7 @@ float autocvar_hud_shownames_crosshairdistance_antioverlap;
bool autocvar_hud_shownames_self; bool autocvar_hud_shownames_self;
bool autocvar_hud_shownames_status; bool autocvar_hud_shownames_status;
float autocvar_hud_shownames_statusbar_height; float autocvar_hud_shownames_statusbar_height;
float autocvar_hud_shownames_statusbar_highlight = 1;
float autocvar_hud_shownames_aspect; float autocvar_hud_shownames_aspect;
float autocvar_hud_shownames_fontsize; float autocvar_hud_shownames_fontsize;
int autocvar_hud_shownames_decolorize; int autocvar_hud_shownames_decolorize;
...@@ -395,12 +397,12 @@ string autocvar_hud_skin; ...@@ -395,12 +397,12 @@ string autocvar_hud_skin;
float autocvar_menu_mouse_speed; float autocvar_menu_mouse_speed;
string autocvar_menu_skin; string autocvar_menu_skin;
int autocvar_r_fakelight; int autocvar_r_fakelight;
int autocvar_r_fullbright; bool autocvar_r_fullbright;
float autocvar_r_letterbox; float autocvar_r_letterbox;
string autocvar_scoreboard_columns; string autocvar_scoreboard_columns;
bool autocvar_v_flipped; bool autocvar_v_flipped;
float autocvar_vid_conheight; int autocvar_vid_conheight;
float autocvar_vid_conwidth; int autocvar_vid_conwidth;
float autocvar_vid_pixelheight; float autocvar_vid_pixelheight;
float autocvar_viewsize; float autocvar_viewsize;
bool autocvar_cl_eventchase_vehicle = 1; bool autocvar_cl_eventchase_vehicle = 1;
...@@ -411,6 +413,8 @@ float autocvar_cl_hitsound_min_pitch = 0.75; ...@@ -411,6 +413,8 @@ float autocvar_cl_hitsound_min_pitch = 0.75;
float autocvar_cl_hitsound_max_pitch = 1.5; float autocvar_cl_hitsound_max_pitch = 1.5;
float autocvar_cl_hitsound_nom_damage = 25; float autocvar_cl_hitsound_nom_damage = 25;
float autocvar_cl_hitsound_antispam_time; float autocvar_cl_hitsound_antispam_time;
int autocvar_cl_eventchase_spectated_change = 1;
float autocvar_cl_eventchase_spectated_change_time = 1;
int autocvar_cl_eventchase_death = 1; int autocvar_cl_eventchase_death = 1;
float autocvar_cl_eventchase_distance = 140; float autocvar_cl_eventchase_distance = 140;
bool autocvar_cl_eventchase_frozen = false; bool autocvar_cl_eventchase_frozen = false;
......
...@@ -43,7 +43,7 @@ void DrawDebugModel(entity this) ...@@ -43,7 +43,7 @@ void DrawDebugModel(entity this)
void LocalCommand_blurtest(int request) void LocalCommand_blurtest(int request)
{ {
TC(int, request); TC(int, request);
// Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now... // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
// Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command. // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
...@@ -79,7 +79,7 @@ void LocalCommand_blurtest(int request) ...@@ -79,7 +79,7 @@ void LocalCommand_blurtest(int request)
void LocalCommand_boxparticles(int request, int argc) void LocalCommand_boxparticles(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -135,7 +135,7 @@ void LocalCommand_boxparticles(int request, int argc) ...@@ -135,7 +135,7 @@ void LocalCommand_boxparticles(int request, int argc)
void LocalCommand_create_scrshot_ent(int request) void LocalCommand_create_scrshot_ent(int request)
{ {
TC(int, request); TC(int, request);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -175,7 +175,7 @@ void LocalCommand_create_scrshot_ent(int request) ...@@ -175,7 +175,7 @@ void LocalCommand_create_scrshot_ent(int request)
void LocalCommand_debugmodel(int request, int argc) void LocalCommand_debugmodel(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -205,7 +205,7 @@ void LocalCommand_debugmodel(int request, int argc) ...@@ -205,7 +205,7 @@ void LocalCommand_debugmodel(int request, int argc)
void LocalCommand_handlevote(int request, int argc) void LocalCommand_handlevote(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -255,7 +255,7 @@ void LocalCommand_handlevote(int request, int argc) ...@@ -255,7 +255,7 @@ void LocalCommand_handlevote(int request, int argc)
void LocalCommand_hud(int request, int argc) void LocalCommand_hud(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -325,7 +325,8 @@ void LocalCommand_hud(int request, int argc) ...@@ -325,7 +325,8 @@ void LocalCommand_hud(int request, int argc)
case "clickradar": case "clickradar":
{ {
HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1); if(!isdemo())
HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
return; return;
} }
} }
...@@ -350,7 +351,7 @@ void LocalCommand_hud(int request, int argc) ...@@ -350,7 +351,7 @@ void LocalCommand_hud(int request, int argc)
void LocalCommand_localprint(int request, int argc) void LocalCommand_localprint(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -377,7 +378,7 @@ void LocalCommand_localprint(int request, int argc) ...@@ -377,7 +378,7 @@ void LocalCommand_localprint(int request, int argc)
void LocalCommand_mv_download(int request, int argc) void LocalCommand_mv_download(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -404,7 +405,7 @@ void LocalCommand_mv_download(int request, int argc) ...@@ -404,7 +405,7 @@ void LocalCommand_mv_download(int request, int argc)
void LocalCommand_sendcvar(int request, int argc) void LocalCommand_sendcvar(int request, int argc)
{ {
TC(int, request); TC(int, argc); TC(int, request); TC(int, argc);
switch (request) switch (request)
{ {
case CMD_REQUEST_COMMAND: case CMD_REQUEST_COMMAND:
...@@ -433,7 +434,7 @@ void LocalCommand_sendcvar(int request, int argc) ...@@ -433,7 +434,7 @@ void LocalCommand_sendcvar(int request, int argc)
case CMD_REQUEST_USAGE: case CMD_REQUEST_USAGE:
{ {
LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>"); LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server."); LOG_INFO(" Where 'cvar' is the cvar to send to the server.");
return; return;
} }
} }
...@@ -476,7 +477,7 @@ CLIENT_COMMAND(handlevote, "System to handle selecting a vote or option") { Loca ...@@ -476,7 +477,7 @@ CLIENT_COMMAND(handlevote, "System to handle selecting a vote or option") { Loca
CLIENT_COMMAND(hud, "Commands regarding/controlling the HUD system") { LocalCommand_hud(request, arguments); } CLIENT_COMMAND(hud, "Commands regarding/controlling the HUD system") { LocalCommand_hud(request, arguments); }
CLIENT_COMMAND(localprint, "Create your own centerprint sent to yourself") { LocalCommand_localprint(request, arguments); } CLIENT_COMMAND(localprint, "Create your own centerprint sent to yourself") { LocalCommand_localprint(request, arguments); }
CLIENT_COMMAND(mv_download, "Retrieve mapshot picture from the server") { LocalCommand_mv_download(request, arguments); } CLIENT_COMMAND(mv_download, "Retrieve mapshot picture from the server") { LocalCommand_mv_download(request, arguments); }
CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like weaponpriority)") { LocalCommand_sendcvar(request, arguments); } CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like cl_weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
void LocalCommand_macro_help() void LocalCommand_macro_help()
{ {
...@@ -564,11 +565,12 @@ void GameCommand(string command) ...@@ -564,11 +565,12 @@ void GameCommand(string command)
// These functions are here specifically to add special + - commands to the game, and are not really normal commands. // These functions are here specifically to add special + - commands to the game, and are not really normal commands.
// Please add client commands to the function above this, as this is only for special reasons. // Please add client commands to the function above this, as this is only for special reasons.
// NOTE: showaccuracy is kept as legacy command
#define CONSOLE_COMMANDS_NORMAL() \ #define CONSOLE_COMMANDS_NORMAL() \
CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \ CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \ CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \ CONSOLE_COMMAND("+showaccuracy", { }) \
CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \ CONSOLE_COMMAND("-showaccuracy", { }) \
/* nothing */ /* nothing */
#define CONSOLE_COMMANDS_MOVEMENT() \ #define CONSOLE_COMMANDS_MOVEMENT() \
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
.float death_time; .float death_time;
.int modelflags; .int modelflags;
.bool isplayermodel;
// FEATURE: LOD // FEATURE: LOD
.int lodmodelindex0; .int lodmodelindex0;
.int lodmodelindex1; .int lodmodelindex1;
...@@ -343,10 +341,10 @@ void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew) ...@@ -343,10 +341,10 @@ void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
// player "pops in" // player "pops in"
if(isnew) if(isnew)
{ {
#define FIX_FRAMETIME(f,ft) MACRO_BEGIN { \ #define FIX_FRAMETIME(f,ft) MACRO_BEGIN \
if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \ if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
this.ft = this.death_time; \ this.ft = this.death_time; \
} MACRO_END MACRO_END
FIX_FRAMETIME(frame, frame1time); FIX_FRAMETIME(frame, frame1time);
FIX_FRAMETIME(frame2, frame2time); FIX_FRAMETIME(frame2, frame2time);
#ifdef CSQCMODEL_HAVE_TWO_FRAMES #ifdef CSQCMODEL_HAVE_TWO_FRAMES
...@@ -362,7 +360,7 @@ void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew) ...@@ -362,7 +360,7 @@ void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
} }
int CSQCPlayer_FallbackFrame(entity this, int f) int CSQCPlayer_FallbackFrame(entity this, int f)
{ {
TC(int, f); TC(int, f);
if(frameduration(this.modelindex, f) > 0) if(frameduration(this.modelindex, f) > 0)
return f; // goooooood return f; // goooooood
if(frameduration(this.modelindex, 1) <= 0) if(frameduration(this.modelindex, 1) <= 0)
...@@ -415,7 +413,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this) ...@@ -415,7 +413,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
// recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch // recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
if(this.tag_entity.classname == "csqcmodel") if(this.tag_entity.classname == "csqcmodel")
{ {
CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.entnum >= 1 && this.tag_entity.entnum <= maxclients)); CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.isplayermodel & ISPLAYER_CLIENT));
} }
if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex) if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
...@@ -443,7 +441,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this) ...@@ -443,7 +441,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it"); LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
} }
} }
else if(this.tag_entity.isplayermodel) else if((this.tag_entity.isplayermodel & ISPLAYER_MODEL))
{ {
skeleton_loadinfo(this.tag_entity); skeleton_loadinfo(this.tag_entity);
this.tag_index = this.tag_entity.bone_weapon; this.tag_index = this.tag_entity.bone_weapon;
...@@ -542,6 +540,9 @@ void CSQCModel_Effects_Apply(entity this) ...@@ -542,6 +540,9 @@ void CSQCModel_Effects_Apply(entity this)
tref = EFFECT_TR_BLOOD.m_id; tref = EFFECT_TR_BLOOD.m_id;
if(this.csqcmodel_modelflags & MF_ROTATE) if(this.csqcmodel_modelflags & MF_ROTATE)
{ {
// This will be hard to replace with MAKE_VECTORS because it's called as part of the predraw function
// as documented in csprogs.h in the engine. The globals can then be read in many places in the engine.
// However MF_ROTATE is currently only used in one place - might be possible to get rid of it entirely.
this.renderflags |= RF_USEAXIS; this.renderflags |= RF_USEAXIS;
makevectors(this.angles + '0 100 0' * fmod(time, 3.6)); makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
} }
...@@ -600,17 +601,22 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer) ...@@ -600,17 +601,22 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
return; return;
this.csqcmodel_predraw_run = framecount; this.csqcmodel_predraw_run = framecount;
if(!this.modelindex || this.model == "null") if(!this.modelindex || this.model == "null" || this.alpha < 0)
{ {
this.drawmask = 0; this.drawmask = 0;
if(this.snd_looping > 0)
{
sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_cl_jetpack_attenuation);
this.snd_looping = 0;
}
return; return;
} }
else else
this.drawmask = MASK_NORMAL; this.drawmask = MASK_NORMAL;
if(this.isplayermodel) // this checks if it's a player MODEL! if((this.isplayermodel & ISPLAYER_MODEL) && this.drawmask) // this checks if it's a player MODEL!
{ {
CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1); CSQCPlayer_ModelAppearance_Apply(this, (this.isplayermodel & ISPLAYER_LOCAL));
CSQCPlayer_LOD_Apply(this); CSQCPlayer_LOD_Apply(this);
if(!isplayer) if(!isplayer)
...@@ -699,7 +705,7 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc ...@@ -699,7 +705,7 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc
this.iflags |= IFLAG_V_ANGLE_X; this.iflags |= IFLAG_V_ANGLE_X;
// revert to values from server // revert to values from server
CSQCModel_Effects_PreUpdate(this); CSQCModel_Effects_PreUpdate(this);
if(this.isplayermodel) if((this.isplayermodel & ISPLAYER_MODEL))
{ {
if(!isplayer) if(!isplayer)
CSQCPlayer_FallbackFrame_PreUpdate(this); CSQCPlayer_FallbackFrame_PreUpdate(this);
...@@ -710,10 +716,12 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc ...@@ -710,10 +716,12 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc
void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer) void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
{ {
// is it a player model? (shared state) // is it a player model? (shared state)
this.isplayermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" || (substring(this.model, 0, 16) == "models/monsters/" && (this.entnum >= 1 && this.entnum <= maxclients))); bool is_playermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" ||
(substring(this.model, 0, 16) == "models/monsters/" && (this.isplayermodel & BIT(1))));
this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_MODEL, is_playermodel);
// save values set by server // save values set by server
if(this.isplayermodel) if((this.isplayermodel & ISPLAYER_MODEL))
{ {
CSQCPlayer_ModelAppearance_PostUpdate(this); CSQCPlayer_ModelAppearance_PostUpdate(this);
if(isplayer) if(isplayer)
......
...@@ -23,6 +23,8 @@ const int MF_TRACER3 = BIT(7); // purple trail ...@@ -23,6 +23,8 @@ const int MF_TRACER3 = BIT(7); // purple trail
.int csqcmodel_modelflags; .int csqcmodel_modelflags;
.int csqcmodel_traileffect; .int csqcmodel_traileffect;
.int isplayermodel;
void CSQCModel_Effects_Apply(entity this); void CSQCModel_Effects_Apply(entity this);
void CSQCModel_Hook_PreDraw(entity this, bool isplayer); void CSQCModel_Hook_PreDraw(entity this, bool isplayer);
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
// Additional OPTIONAL Fields and Globals // Additional OPTIONAL Fields and Globals
//float intermission; //float intermission;
float scoreboard_showscores; float scoreboard_showscores;
float scoreboard_showaccuracy;
.string message; .string message;
.int renderflags; .float renderflags;
// float coop; // float coop;
// float deathmatch; // float deathmatch;
...@@ -16,7 +15,6 @@ float dmg_take; ...@@ -16,7 +15,6 @@ float dmg_take;
// Darkplaces Render Modifications // Darkplaces Render Modifications
#if 0 #if 0
.float alpha; .float alpha;
.float renderflags;
.vector colormod; .vector colormod;
.float scale; .float scale;
#endif #endif
...@@ -78,6 +76,7 @@ float nb_pb_period; ...@@ -78,6 +76,7 @@ float nb_pb_period;
// 0 - playing // 0 - playing
// >0 - id of spectated player // >0 - id of spectated player
float spectatee_status; float spectatee_status;
float spectatee_status_changed_time;
// short mapname // short mapname
string shortmapname; string shortmapname;
...@@ -110,10 +109,73 @@ int w_deathtype; ...@@ -110,10 +109,73 @@ int w_deathtype;
float w_issilent, w_random; float w_issilent, w_random;
vector w_org, w_backoff; vector w_org, w_backoff;
float autoswitch;
bool cvar_cl_allow_uid2name;
bool cvar_cl_allow_uidranking;
float cvar_cl_autoscreenshot;
float cvar_cl_autotaunt;
float cvar_cl_clippedspectating;
int cvar_cl_gunalign;
float cvar_cl_handicap;
float cvar_cl_jetpack_jump;