X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=27c04f8a4d02499a2549a81c9aedec74ec53958e;hb=3eb07615a1d828cfe7d7243509820eb8ec7a90b0;hp=9b0324755a41669bc1b6d0a750a306d45d481bba;hpb=69483a31c5452d2ba20ed4219f8a978b6db10555;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 9b0324755..27c04f8a4 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -367,13 +367,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) { @@ -586,6 +586,7 @@ void GetCvars(float f) 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"); + GetCvars_handleFloat(s, f, cvar_cl_clippedspectating, "cl_clippedspectating"); GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList); GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete); GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete); @@ -615,6 +616,8 @@ void GetCvars(float f) GetCvars_handleFloatOnce(s, f, cvar_cl_gunalign, "cl_gunalign"); 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) @@ -737,13 +740,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 @@ -1119,6 +1122,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")) @@ -1178,7 +1183,6 @@ void readlevelcvars(void) g_bloodloss = cvar("g_bloodloss"); sv_maxidle = cvar("sv_maxidle"); sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle"); - sv_pogostick = cvar("sv_pogostick"); g_ctf_reverse = cvar("g_ctf_reverse"); sv_autotaunt = cvar("sv_autotaunt"); sv_taunt = cvar("sv_taunt"); @@ -1255,9 +1259,6 @@ void readlevelcvars(void) if(!g_weapon_stay) g_weapon_stay = cvar("g_weapon_stay"); - if (!g_weapon_stay && (cvar("deathmatch") == 2)) - g_weapon_stay = 1; - g_ghost_items = cvar("g_ghost_items"); if(g_ghost_items >= 1) @@ -1291,7 +1292,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; @@ -1457,7 +1460,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; @@ -1631,7 +1634,7 @@ void precache() if(autocvar_sv_precacheweapons) { //precache weapon models/sounds - local float wep; + float wep; wep = WEP_FIRST; while (wep <= WEP_LAST) { @@ -1672,8 +1675,7 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, msg_entity = e; WRITESPECTATABLE_MSG_ONE({ WriteByte(MSG_ONE, SVC_TEMPENTITY); - WriteByte(MSG_ONE, TE_CSQC_NOTIFY); - WriteByte(MSG_ONE, CSQC_CENTERPRINT_GENERIC); + WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC); WriteByte(MSG_ONE, id); WriteString(MSG_ONE, s); if (id != 0 && s != "") @@ -1753,6 +1755,8 @@ void remove_except_protected(entity e) void remove_unsafely(entity e) { + if(e.classname == "spike") + error("Removing spikes is forbidden (crylink bug), please report"); remove_builtin(e); } @@ -2014,6 +2018,7 @@ float SUB_NoImpactCheck() #define SUB_OwnerCheck() (other && (other == self.owner)) void RemoveGrapplingHook(entity pl); +void W_Crylink_Dequeue(entity e); float WarpZone_Projectile_Touch_ImpactFilter_Callback() { if(SUB_OwnerCheck()) @@ -2022,6 +2027,11 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback() { if(self.classname == "grapplinghook") RemoveGrapplingHook(self.realowner); + else if(self.classname == "spike") + { + W_Crylink_Dequeue(self); + remove(self); + } else remove(self); return TRUE; @@ -2037,7 +2047,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) { @@ -2045,7 +2054,11 @@ void URI_Get_Callback(float id, float status, string data) dprint(data); dprint("\nEnd of data.\n"); - if (id == URI_GET_DISCARD) + if(url_URI_Get_Callback(id, status, data)) + { + // handled + } + else if (id == URI_GET_DISCARD) { // discard } @@ -2054,10 +2067,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"); @@ -2463,6 +2472,7 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f { float m, i; vector start, org, delta, end, enddown, mstart; + entity sp; m = e.dphitcontentsmask; e.dphitcontentsmask = goodcontents | badcontents; @@ -2515,6 +2525,19 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f if (trace_fraction >= 1) continue; + // rule 4: we must "see" some spawnpoint + for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); ) + if(checkpvs(mstart, sp)) + break; + if(!sp) + { + for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); ) + if(checkpvs(mstart, sp)) + break; + if(!sp) + continue; + } + // find a random vector to "look at" end_x = org_x + random() * delta_x; end_y = org_y + random() * delta_y;