]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/throwing.qc
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / throwing.qc
index aecaafb1854111d7aa7b271f5c670ec2742b9069..89ec52f2179f5114230addfe9eb567aa6909c55a 100644 (file)
@@ -1,20 +1,14 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "throwing.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../../common/mapinfo.qh"
-#endif
+#include "throwing.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../mutators/mutators_include.qh"
+#include "../t_items.qh"
+#include "../g_damage.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/all.qh"
 
 void thrown_wep_think()
 {
@@ -107,24 +101,24 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammotype += self.(weapon_load[self.weapon]);
+                               own.(ammotype) += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       wep.ammotype = 0;
+                       wep.(ammotype) = 0;
                }
                else if(doreduce)
                {
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammotype += self.(weapon_load[self.weapon]);
+                               own.(ammotype) += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       thisammo = min(own.ammotype, wep.ammotype);
-                       wep.ammotype = thisammo;
-                       own.ammotype -= thisammo;
+                       thisammo = min(own.(ammotype), wep.(ammotype));
+                       wep.(ammotype) = thisammo;
+                       own.(ammotype) -= thisammo;
 
                        switch(ammotype)
                        {
@@ -150,7 +144,7 @@ float W_IsWeaponThrowable(float w)
                return 0;
        if (g_cts)
                return 0;
-       if (g_nexball && w == WEP_MORTAR)
+       if (g_nexball && w == WEP_MORTAR.m_id)
                return 0;
     if(w == 0)
         return 0;