X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=6db6454f6b904ddaf0a4b355c8d9d2111a1441e8;hb=02bdc3f123932f71f2f9456fa56f2107f69caedf;hp=9a848fa46ebbe7eda5bc4b49735165f1e8573f84;hpb=6b33ff36e2a85c61d18cf0acb4bfd15c1eb7e5a8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 9a848fa46..6db6454f6 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -8,6 +8,21 @@ void crosshair_trace(entity pl) { traceline_antilag(pl, pl.cursor_trace_start, pl.cursor_trace_start + normalize(pl.cursor_trace_endpos - pl.cursor_trace_start) * MAX_SHOT_DISTANCE, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl)); } +void crosshair_trace_plusvisibletriggers(entity pl) +{ + entity first; + entity e; + first = findchainfloat(solid, SOLID_TRIGGER); + + for (e = first; e; e = e.chain) + if (e.model != "") + e.solid = SOLID_BSP; + + crosshair_trace(pl); + + for (e = first; e; e = e.chain) + e.solid = SOLID_TRIGGER; +} void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag); void WarpZone_crosshair_trace(entity pl) { @@ -367,13 +382,13 @@ void spawnfunc_target_location() self.classname = "target_location"; // location name in netname // eventually support: count, teamgame selectors, line of sight? -}; +} void spawnfunc_info_location() { self.classname = "target_location"; self.message = self.netname; -}; +} string NearestLocation(vector p) { @@ -583,6 +598,7 @@ void GetCvars(float f) get_cvars_s = s; MUTATOR_CALLHOOK(GetCvars); GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch"); + GetCvars_handleFloat(s, f, cvar_cl_autoscreenshot, "cl_autoscreenshot"); GetCvars_handleFloat(s, f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction"); GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion"); GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap"); @@ -617,6 +633,7 @@ void GetCvars(float f) GetCvars_handleFloat(s, f, cvar_cl_allow_uid2name, "cl_allow_uid2name"); GetCvars_handleFloat(s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking"); GetCvars_handleFloat(s, f, cvar_cl_movement_track_canjump, "cl_movement_track_canjump"); + GetCvars_handleFloat(s, f, cvar_cl_newusekeysupported, "cl_newusekeysupported"); // fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early) if (f > 0) @@ -739,13 +756,13 @@ string playername(entity p) vector randompos(vector m1, vector m2) { - local vector v; + vector v; m2 = m2 - m1; v_x = m2_x * random() + m1_x; v_y = m2_y * random() + m1_y; v_z = m2_z * random() + m1_z; return v; -}; +} //#NO AUTOCVARS START @@ -1121,6 +1138,8 @@ string GetGametype(); // g_world.qc void readlevelcvars(void) { // first load all the mutators + if(cvar("g_invincible_projectiles")) + MUTATOR_ADD(mutator_invincibleprojectiles); if(cvar("g_nix")) MUTATOR_ADD(mutator_nix); if(cvar("g_dodging")) @@ -1129,6 +1148,8 @@ void readlevelcvars(void) MUTATOR_ADD(mutator_rocketflying); if(cvar("g_vampire")) MUTATOR_ADD(mutator_vampire); + if(cvar("g_sandbox")) + MUTATOR_ADD(sandbox); if(cvar("sv_allow_fullbright")) serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; @@ -1289,7 +1310,9 @@ float sound_allowed(float dest, entity e) { if (e.classname == "body") e = e.enemy; - if (e.owner && e.owner != e) + else if (e.realowner && e.realowner != e) + e = e.realowner; + else if (e.owner && e.owner != e) e = e.owner; else break; @@ -1455,7 +1478,7 @@ float spamsound(entity e, float chan, string samp, float vol, float atten) void play2team(float t, string filename) { - local entity head; + entity head; if (autocvar_bot_sound_monopoly) return; @@ -1629,7 +1652,7 @@ void precache() if(autocvar_sv_precacheweapons) { //precache weapon models/sounds - local float wep; + float wep; wep = WEP_FIRST; while (wep <= WEP_LAST) { @@ -2042,7 +2065,6 @@ float MAX_IPBAN_URIS = 16; float URI_GET_DISCARD = 0; float URI_GET_IPBAN = 1; float URI_GET_IPBAN_END = 16; -float URI_GET_PLAYERSTATS_SENT = 17; void URI_Get_Callback(float id, float status, string data) { @@ -2063,10 +2085,6 @@ void URI_Get_Callback(float id, float status, string data) // online ban list OnlineBanList_URI_Get_Callback(id, status, data); } - else if (id == URI_GET_PLAYERSTATS_SENT) - { - PlayerStats_Sent_URI_Get_Callback(id, status, data); - } else { print("Received HTTP request data for an invalid id ", ftos(id), ".\n");