]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge branch 'master' into Mario/ons_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index b1f56b941348a646086cdaba51ec415a3b288ebc..81e0a41df0d9bb3aac224215187103219621013d 100644 (file)
@@ -6,7 +6,6 @@
 #include "g_hook.qh"
 #include "ipban.qh"
 #include "mutators/mutators_include.qh"
-#include "tturrets/include/turrets_early.qh"
 #include "t_items.qh"
 #include "weapons/accuracy.qh"
 #include "weapons/csqcprojectile.qh"
@@ -21,6 +20,7 @@
 #include "../common/triggers/subs.qh"
 #include "../common/urllib.qh"
 #include "../common/util.qh"
+#include "../common/turrets/sv_turrets.qh"
 #include "../common/weapons/all.qh"
 #include "../csqcmodellib/sv_model.qh"
 #include "../warpzonelib/anglestransform.qh"
@@ -303,11 +303,11 @@ string formatmessage(string msg)
                                wep = self.cnt;
                        replacement = WEP_NAME(wep);
                } else if (escape == "W") {
-                       if (self.items & IT_SHELLS) replacement = "shells";
-                       else if (self.items & IT_NAILS) replacement = "bullets";
-                       else if (self.items & IT_ROCKETS) replacement = "rockets";
-                       else if (self.items & IT_CELLS) replacement = "cells";
-                       else if (self.items & IT_PLASMA) replacement = "plasma";
+                       if (self.items & ITEM_Shells.m_itemid) replacement = "shells";
+                       else if (self.items & ITEM_Bullets.m_itemid) replacement = "bullets";
+                       else if (self.items & ITEM_Rockets.m_itemid) replacement = "rockets";
+                       else if (self.items & ITEM_Cells.m_itemid) replacement = "cells";
+                       else if (self.items & ITEM_Plasma.m_itemid) replacement = "plasma";
                        else replacement = "batteries"; // ;)
                } else if (escape == "x") {
                        replacement = cursor_ent.netname;
@@ -427,7 +427,6 @@ void GetCvars(float f)
 
        get_cvars_f = f;
        get_cvars_s = s;
-
        MUTATOR_CALLHOOK(GetCvars);
 
        Notification_GetCvars();
@@ -506,14 +505,14 @@ float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still ne
                        d = false;
        }
        else if (g_cts)
-               d = (i == WEP_SHOTGUN);
+               d = (i == WEP_SHOTGUN.m_id);
        else if (g_nexball)
                d = 0; // weapon is set a few lines later
        else
                d = !(!weaponinfo.weaponstart);
 
        if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
-               d |= (i == WEP_HOOK);
+               d |= (i == WEP_HOOK.m_id);
        if(!g_cts && (weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED)) // never default mutator blocked guns
                d = 0;
 
@@ -715,13 +714,13 @@ void readplayerstartcvars()
        }
 
        if (g_jetpack)
-               start_items |= IT_JETPACK;
+               start_items |= ITEM_Jetpack.m_itemid;
 
        MUTATOR_CALLHOOK(SetStartItems);
 
-       if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
+       if ((start_items & ITEM_Jetpack.m_itemid) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
        {
-               start_items |= IT_FUEL_REGEN;
+               start_items |= ITEM_JetpackRegen.m_itemid;
                start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
@@ -990,11 +989,6 @@ void precache()
     precache_model ("models/misc/chatbubble.spr");
        precache_model("models/ice/ice.md3");
 
-#ifdef TTURRETS_ENABLED
-    if (autocvar_g_turrets)
-        turrets_precash();
-#endif
-
     // Precache all player models if desired
     if (autocvar_sv_precacheplayermodels)
     {