]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
beginning of "pure server" checking... the rule is simple: only settings in the offic...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index bcd1ea7d08c4bbc7d0549afff9e7692aa321c185..668e86f8984003f6096b2f58e36e8086608d3928 100644 (file)
@@ -100,9 +100,9 @@ string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
 
        if(cvar("sv_fragmessage_information_ping")) {
                if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
-                       strMessage = strcat(strMessage, "\n^7(^2Bot");
+                       strMessage = strcat(strMessage, " ^7(^2Bot");
                else
-                       strMessage = strcat(strMessage, "\n^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
+                       strMessage = strcat(strMessage, " ^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
                if(cvar("sv_fragmessage_information_handicap"))
                        if(cvar("sv_fragmessage_information_handicap") == 2)
                                if(nPlayerHandicap <= 1)
@@ -229,12 +229,6 @@ void relocate_spawnpoint()
         }
     }
 
-    if (cvar("g_spawnpoints_autodrop"))
-    {
-        setsize(self, PL_MIN, PL_MAX);
-        droptofloor();
-    }
-
     self.use = spawnpoint_use;
     self.team_saved = self.team;
     if (!self.cnt)
@@ -587,9 +581,19 @@ void GetCvars_handleFloatOnce(string thisname, float f, .float field, string nam
                        stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
        }
 }
-string W_FixWeaponOrder_ForceComplete(string s);
-string W_FixWeaponOrder_AllowIncomplete(string s);
 float w_getbestweapon(entity e);
+string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
+{
+       string o;
+       o = W_FixWeaponOrder_ForceComplete(wo);
+       if(self.weaponorder_byimpulse)
+       {
+               strunzone(self.weaponorder_byimpulse);
+               self.weaponorder_byimpulse = string_null;
+       }
+       self.weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(o));
+       return o;
+}
 void GetCvars(float f)
 {
        string s;
@@ -606,7 +610,7 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, cvar_cl_shownames, "cl_shownames");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
-       GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete);
+       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);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
@@ -825,20 +829,30 @@ float g_pickup_fuel_jetpack;
 float g_pickup_fuel_max;
 float g_pickup_armorsmall;
 float g_pickup_armorsmall_max;
+float g_pickup_armorsmall_anyway;
 float g_pickup_armormedium;
 float g_pickup_armormedium_max;
+float g_pickup_armormedium_anyway;
 float g_pickup_armorbig;
 float g_pickup_armorbig_max;
+float g_pickup_armorbig_anyway;
 float g_pickup_armorlarge;
 float g_pickup_armorlarge_max;
+float g_pickup_armorlarge_anyway;
 float g_pickup_healthsmall;
 float g_pickup_healthsmall_max;
+float g_pickup_healthsmall_anyway;
 float g_pickup_healthmedium;
 float g_pickup_healthmedium_max;
+float g_pickup_healthmedium_anyway;
 float g_pickup_healthlarge;
 float g_pickup_healthlarge_max;
+float g_pickup_healthlarge_anyway;
 float g_pickup_healthmega;
 float g_pickup_healthmega_max;
+float g_pickup_healthmega_anyway;
+float g_pickup_ammo_anyway;
+float g_pickup_weapons_anyway;
 float g_weaponarena;
 float g_weaponarena_random;
 string g_weaponarena_list;
@@ -985,7 +999,7 @@ void readplayerstartcvars()
        if (g_weaponarena)
        {
                start_weapons = g_weaponarena;
-               if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER))
+               if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_MINE_LAYER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER))
                        start_ammo_rockets = 999;
                if (g_weaponarena & WEPBIT_SHOTGUN)
                        start_ammo_shells = 999;
@@ -1168,6 +1182,10 @@ void readlevelcvars(void)
        // first load all the mutators
        if(cvar("g_nix"))
                MUTATOR_ADD(mutator_nix);
+       if(cvar("g_dodging"))
+               MUTATOR_ADD(mutator_dodging);
+       if(cvar("g_rocket_flying") || (cvar("g_balance_rocketlauncher_detonatedelay") == 0 && stof(cvar_defstring("g_balance_rocketlauncher_detonatedelay")) != 0))
+               MUTATOR_ADD(mutator_rocketflying);
 
     g_bugrigs = cvar("g_bugrigs");
     g_bugrigs_planar_movement = cvar("g_bugrigs_planar_movement");
@@ -1217,7 +1235,6 @@ void readlevelcvars(void)
        sv_maxidle = cvar("sv_maxidle");
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
        sv_pogostick = cvar("sv_pogostick");
-       sv_doublejump = cvar("sv_doublejump");
        g_ctf_reverse = cvar("g_ctf_reverse");
        sv_autotaunt = cvar("sv_autotaunt");
        sv_taunt = cvar("sv_taunt");
@@ -1262,20 +1279,31 @@ void readlevelcvars(void)
        g_pickup_fuel_max = cvar("g_pickup_fuel_max");
        g_pickup_armorsmall = cvar("g_pickup_armorsmall");
        g_pickup_armorsmall_max = cvar("g_pickup_armorsmall_max");
+       g_pickup_armorsmall_anyway = cvar("g_pickup_armorsmall_anyway");
        g_pickup_armormedium = cvar("g_pickup_armormedium");
        g_pickup_armormedium_max = cvar("g_pickup_armormedium_max");
+       g_pickup_armormedium_anyway = cvar("g_pickup_armormedium_anyway");
        g_pickup_armorbig = cvar("g_pickup_armorbig");
        g_pickup_armorbig_max = cvar("g_pickup_armorbig_max");
+       g_pickup_armorbig_anyway = cvar("g_pickup_armorbig_anyway");
        g_pickup_armorlarge = cvar("g_pickup_armorlarge");
        g_pickup_armorlarge_max = cvar("g_pickup_armorlarge_max");
+       g_pickup_armorlarge_anyway = cvar("g_pickup_armorlarge_anyway");
        g_pickup_healthsmall = cvar("g_pickup_healthsmall");
        g_pickup_healthsmall_max = cvar("g_pickup_healthsmall_max");
+       g_pickup_healthsmall_anyway = cvar("g_pickup_healthsmall_anyway");
        g_pickup_healthmedium = cvar("g_pickup_healthmedium");
        g_pickup_healthmedium_max = cvar("g_pickup_healthmedium_max");
+       g_pickup_healthmedium_anyway = cvar("g_pickup_healthmedium_anyway");
        g_pickup_healthlarge = cvar("g_pickup_healthlarge");
        g_pickup_healthlarge_max = cvar("g_pickup_healthlarge_max");
+       g_pickup_healthlarge_anyway = cvar("g_pickup_healthlarge_anyway");
        g_pickup_healthmega = cvar("g_pickup_healthmega");
        g_pickup_healthmega_max = cvar("g_pickup_healthmega_max");
+       g_pickup_healthmega_anyway = cvar("g_pickup_healthmega_anyway");
+
+       g_pickup_ammo_anyway = cvar("g_pickup_ammo_anyway");
+       g_pickup_weapons_anyway = cvar("g_pickup_weapons_anyway");
 
        g_pinata = cvar("g_pinata");
 
@@ -1583,6 +1611,7 @@ void precache()
         precache_all_playermodels("models/player/*.dpm");
         precache_all_playermodels("models/player/*.md3");
         precache_all_playermodels("models/player/*.psk");
+        precache_all_playermodels("models/player/*.iqm");
     }
 
     if (cvar("sv_defaultcharacter"))
@@ -1653,6 +1682,7 @@ void precache()
     precache_sound ("weapons/weapon_switch.wav");
     precache_sound ("weapons/weaponpickup.wav");
     precache_sound ("weapons/unavailable.wav");
+    precache_sound ("weapons/dryfire.wav");
     if (g_grappling_hook)
     {
         precache_sound ("weapons/hook_fire.wav"); // hook
@@ -1702,7 +1732,6 @@ void precache()
 #define INITPRIO_FIRST              0
 #define INITPRIO_GAMETYPE           0
 #define INITPRIO_GAMETYPE_FALLBACK  1
-#define INITPRIO_CVARS              5
 #define INITPRIO_FINDTARGET        10
 #define INITPRIO_DROPTOFLOOR       20
 #define INITPRIO_SETLOCATION       90
@@ -1894,6 +1923,13 @@ void adaptor_think2use()
     activator = a;
 }
 
+void adaptor_think2use_hittype_splash() // for timed projectile detonation
+{
+       if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+               self.projectiledeathtype |= HITTYPE_SPLASH;
+       adaptor_think2use();
+}
+
 // deferred dropping
 void DropToFloor_Handler()
 {
@@ -2308,9 +2344,9 @@ void write_recordmarker(entity pl, float tstart, float dt)
                  " ", ftos(tstart), " ", ftos(dt), "\n"));
 }
 
-vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter)
+vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter, float algn)
 {
-       switch(self.owner.cvar_cl_gunalign)
+       switch(algn)
        {
                case 1: // right
                        break;
@@ -2325,7 +2361,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
                        {
                                // center
                                vecs_y = 0;
-                               vecs_z -= 4;
+                               vecs_z -= 2;
                        }
                        else
                        {
@@ -2338,7 +2374,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
                        {
                                // center
                                vecs_y = 0;
-                               vecs_z -= 4;
+                               vecs_z -= 2;
                        }
                        else
                        {
@@ -2350,7 +2386,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
        return vecs;
 }
 
-vector shotorg_adjust(vector vecs, float y_is_right, float visual)
+vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn)
 {
        string s;
        vector v;
@@ -2359,7 +2395,7 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        {
                if (visual)
                {
-                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE);
+                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE, algn);
                }
                else
                {
@@ -2371,12 +2407,12 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        {
                if (visual)
                {
-                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE);
+                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE, algn);
                }
                else
                {
                        vecs_y = 0;
-                       vecs_z -= 4;
+                       vecs_z -= 2;
                }
        }
        else if ((s = cvar_string("g_shootfromfixedorigin")) != "")
@@ -2391,11 +2427,15 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        }
        else if (cvar("g_shootfromclient"))
        {
-               vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2));
+               vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2), algn);
        }
        return vecs;
 }
 
+vector shotorg_adjust(vector vecs, float y_is_right, float visual)
+{
+       return shotorg_adjust_values(vecs, y_is_right, visual, self.owner.cvar_cl_gunalign);
+}
 
 
 void attach_sameorigin(entity e, entity to, string tag)