]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapons.qc
Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapons.qc
index ff97b16c51d7fc9dcccf0621e3eee07560c42363..55fcc0e14ffa597cbfaace6da0d52f09a4329f4d 100644 (file)
@@ -1,6 +1,11 @@
+#ifndef WEAPONS_C
+#define WEAPONS_C
+
+#include "weapons.qh"
+
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qc"
-       #include "../../client/Defs.qc"
+       #include "../../dpdefs/csprogsdefs.qh"
+       #include "../../client/defs.qh"
        #include "../constants.qh"
        #include "../stats.qh"
        #include "../../warpzonelib/anglestransform.qh"
@@ -9,7 +14,6 @@
        #include "../../warpzonelib/client.qh"
        #include "../util.qh"
        #include "../buffs.qh"
-       #include "weapons.qh"
        #include "../../client/autocvars.qh"
        #include "../deathtypes.qh"
        #include "../../csqcmodellib/interpolate.qh"
@@ -18,9 +22,8 @@
        #include "../../csqcmodellib/cl_model.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qc"
-    #include "../../dpdefs/dpextensions.qc"
-    #include "../../server/sys-post.qh"
+       #include "../../dpdefs/progsdefs.qh"
+    #include "../../dpdefs/dpextensions.qh"
     #include "../../warpzonelib/anglestransform.qh"
     #include "../../warpzonelib/mathlib.qh"
     #include "../../warpzonelib/common.qh"
@@ -33,7 +36,6 @@
     #include "../buffs.qh"
     #include "../monsters/monsters.qh"
     #include "config.qh"
-    #include "weapons.qh"
     #include "../../server/weapons/csqcprojectile.qh"
     #include "../../server/weapons/tracing.qh"
     #include "../../server/t_items.qh"
@@ -104,11 +106,11 @@ void WriteWepSet(float dst, WepSet w)
 WepSet WepSet_GetFromStat()
 {
        WepSet w = '0 0 0';
-       w_x = getstati(STAT_WEAPONS);
+       w.x = getstati(STAT_WEAPONS);
 #if WEP_MAXCOUNT > 24
-       w_y = getstati(STAT_WEAPONS2);
+       w.y = getstati(STAT_WEAPONS2);
 #if WEP_MAXCOUNT > 48
-       w_z = getstati(STAT_WEAPONS3);
+       w.z = getstati(STAT_WEAPONS3);
 #endif
 #endif
        return w;
@@ -163,7 +165,7 @@ void register_weapon(
        e.netname = refname;
        e.message = wepname;
 
-       #ifndef MENUQC
+       #ifdef CSQC
        func(WR_INIT);
        #endif
 }
@@ -192,7 +194,7 @@ void register_weapons_done()
        dummy_weapon_info.w_crosshair_size = 1;
        dummy_weapon_info.model2 = "";
 
-       float i;
+       int i;
        weaponorder_byid = "";
        for(i = WEP_MAXCOUNT; i >= 1; --i)
                if(weapon_info[i-1])
@@ -230,7 +232,7 @@ string W_UndeprecateName(string s)
        switch ( s )
        {
                case "nex"            : return "vortex";
-               case "rocketlauncher" : return "devastator"; 
+               case "rocketlauncher" : return "devastator";
                case "laser"          : return "blaster";
                case "minstanex"      : return "vaporizer";
                case "grenadelauncher": return "mortar";
@@ -342,7 +344,7 @@ string GetAmmoPicture(.float ammotype)
 }
 
 #ifdef CSQC
-.float GetAmmoFieldFromNum(float i)
+.float GetAmmoFieldFromNum(int i)
 {
        switch(i)
        {
@@ -356,7 +358,7 @@ string GetAmmoPicture(.float ammotype)
        }
 }
 
-float GetAmmoStat(.float ammotype)
+int GetAmmoStat(.float ammotype)
 {
        switch(ammotype)
        {
@@ -370,3 +372,4 @@ float GetAmmoStat(.float ammotype)
        }
 }
 #endif
+#endif