]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix compilation units
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Oct 2017 10:43:47 +0000 (21:43 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Oct 2017 10:43:47 +0000 (21:43 +1100)
15 files changed:
qcsrc/common/items/inventory.qh
qcsrc/common/items/item.qh
qcsrc/common/items/item/ammo.qh
qcsrc/common/items/item/pickup.qc
qcsrc/common/items/item/pickup.qh
qcsrc/common/mutators/mutator/overkill/hmg.qh
qcsrc/common/mutators/mutator/overkill/rpc.qh
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/stats.qh
qcsrc/common/t_items.qh
qcsrc/common/weapons/weapon.qh
qcsrc/server/compat/quake2.qc
qcsrc/server/defs.qh
qcsrc/server/items.qc
qcsrc/server/items.qh

index a022979a7065f7ee07c8cdfb0fc94c3ab9a0038a..8520075019b97c616107cabf94420ef9a27d58d6 100644 (file)
@@ -1,7 +1,6 @@
 #pragma once
 
 #include "all.qh"
-#include "item/pickup.qh"
 
 CLASS(Inventory, Object)
     /** Stores counts of items, the id being the index */
@@ -81,7 +80,7 @@ void Inventory_Write(Inventory data)
             if (!(minorBits & BIT(j))) { \
                 continue; \
             } \
-            const GameItem it = Items_from(Inventory_groups_minor * maj + j); \
+            const entity it = Items_from(Inventory_groups_minor * maj + j); \
             WriteByte(MSG_ENTITY, data.inv_items[it.m_id]); \
         } \
     } \
index d5b25c436b120adc11a850f9a6c674eed0c3097c..6ec6dd8a4a843cf000b03d91b6d72fed1b94d63a 100644 (file)
@@ -1,9 +1,10 @@
 #pragma once
-#include <common/t_items.qh>
 
 #ifdef GAMEQC
+#include <common/models/all.qh>
 #include <common/sounds/all.qh>
 #include <common/sounds/all.inc>
+#include <common/stats.qh>
 #endif
 
 const int IT_UNLIMITED_WEAPON_AMMO             =  BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
index b9b6fc158552c47dc42252a388bf40049798413f..cc3cfe06419b39499374bb05bdc6747a6ee48a7f 100644 (file)
@@ -5,6 +5,19 @@
     #include <common/t_items.qh>
 #endif
 
+.int ammo_none;
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+#ifdef SVQC
+.int ammo_plasma = _STAT(PLASMA);
+.int ammo_fuel = _STAT(FUEL);
+#else
+.int ammo_plasma;
+.int ammo_fuel;
+#endif
+
 #ifdef SVQC
 PROPERTY(float, g_pickup_ammo_anyway);
 #endif
index fc958709e87d66af6eb50b958ce71ab8ef8f11b2..b5944fc0a3def7d7235f09bfc66e6ad33f2fb11e 100644 (file)
@@ -1,7 +1,21 @@
 #include "pickup.qh"
+#include <common/items/inventory.qh>
 
 #ifdef SVQC
 bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
     return this.giveTo(this, item, player);
 }
+
+METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
+{
+    TC(Pickup, this);
+    bool b = Item_GiveTo(item, player);
+    if (b) {
+        LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
+        player.inventory.inv_items[this.m_id]++;
+        Inventory_update(player);
+    }
+    return b;
+}
+
 #endif
index 39cf78cc3016e3d3b4714bcf169c843892342f59..fb4bc28cd8ede336f7d6d656ca25edbdd4972e42 100644 (file)
@@ -17,15 +17,7 @@ PROPERTY(float, g_pickup_respawntimejitter_long)
 PROPERTY(float, g_pickup_respawntimejitter_powerup)
 #endif
 
-#include <common/items/inventory.qh>
 #include <common/items/item.qh>
-#include <common/t_items.qh>
-
-#ifdef GAMEQC
-#include <common/models/all.qh>
-#include <common/sounds/all.qh>
-#include <common/sounds/all.inc>
-#endif
 
 CLASS(Pickup, GameItem)
 #ifdef GAMEQC
@@ -52,17 +44,7 @@ CLASS(Pickup, GameItem)
     ATTRIB(Pickup, m_pickupanyway, float());
     ATTRIB(Pickup, m_iteminit, void(entity item));
     float Item_GiveTo(entity item, entity player);
-    METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
-    {
-        TC(Pickup, this);
-        bool b = Item_GiveTo(item, player);
-        if (b) {
-            LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
-            player.inventory.inv_items[this.m_id]++;
-            Inventory_update(player);
-        }
-        return b;
-    }
+    METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player));
     bool ITEM_HANDLE(Pickup, Pickup this, entity item, entity player);
 #endif
 ENDCLASS(Pickup)
index 49457fb76f16dfc6aff7923cc4784d1e4a3f822f..99c8093970e4bc6ef7acd2c69bbc516b8093a244 100644 (file)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <common/weapons/all.qh>
+
 CLASS(HeavyMachineGun, Weapon)
 /* spawnfunc */ ATTRIB(HeavyMachineGun, m_canonical_spawnfunc, string, "weapon_hmg");
 /* ammotype  */ ATTRIB(HeavyMachineGun, ammo_type, int, RESOURCE_BULLETS);
index a6891a05d31c6b14b57f9fd0747b6106c53893a2..78d5de51ae4621249a2c23f55fbefdd5a5df468b 100644 (file)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <common/weapons/all.qh>
+
 CLASS(RocketPropelledChainsaw, Weapon)
 /* spawnfunc */ ATTRIB(RocketPropelledChainsaw, m_canonical_spawnfunc, string, "weapon_rpc");
 /* ammotype  */ ATTRIB(RocketPropelledChainsaw, ammo_type, int, RESOURCE_ROCKETS);
index 734a14baee95ec3da8a5d9d5ad6c6fa676f19f86..6b32ec35299f4b478e071272c30411718692ed2c 100644 (file)
@@ -11,13 +11,18 @@ bool autocvar_g_overkill_itemwaypoints = true;
 
 .Weapon ok_lastwep[MAX_WEAPONSLOTS];
 
-void ok_Initialize();
-
 REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
 {
        MUTATOR_ONADD
        {
-               ok_Initialize();
+               precache_all_playermodels("models/ok_player/*.dpm");
+
+               WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+               WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+
+               WEP_SHOTGUN.mdl = "ok_shotgun";
+               WEP_MACHINEGUN.mdl = "ok_mg";
+               WEP_VORTEX.mdl = "ok_sniper";
        }
 
        MUTATOR_ONREMOVE
@@ -285,15 +290,3 @@ MUTATOR_HOOKFUNCTION(ok, SetModname)
        M_ARGV(0, string) = "Overkill";
        return true;
 }
-
-void ok_Initialize()
-{
-       precache_all_playermodels("models/ok_player/*.dpm");
-
-       WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-       WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-
-       WEP_SHOTGUN.mdl = "ok_shotgun";
-       WEP_MACHINEGUN.mdl = "ok_mg";
-       WEP_VORTEX.mdl = "ok_sniper";
-}
index 94e408d7f614be2d769fc229625a390bfd357ba0..71149463c59499e90bc87f8c44c57cfbc2a9c73d 100644 (file)
@@ -295,6 +295,7 @@ REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
 
 #ifdef SVQC
 #include "physics/movetypes/movetypes.qh"
+float warmup_limit;
 #endif
 
 REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
index 7eb863e32693a444c10ca97e7579ee1225f37d64..5ecbe548824bef246be9e2ccf45b5b95882df09d 100644 (file)
@@ -1,9 +1,5 @@
 #pragma once
 
-#ifdef SVQC
-#include <server/defs.qh>
-#endif
-
 const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
 // item networking
index fa62ffbd349490fe022fe71344470704b6c2f3a4..b5f542928f3fc4d869999c8b379a414143eb2a8e 100644 (file)
@@ -37,24 +37,6 @@ const int WS_INUSE  = 3;
 /** idle frame */
 const int WS_READY  = 4;
 
-#ifdef SVQC
-.int ammo_shells;
-.int ammo_nails;
-.int ammo_rockets;
-.int ammo_cells;
-.int ammo_plasma = _STAT(PLASMA);
-.int ammo_fuel = _STAT(FUEL);
-.int ammo_none;
-#else
-.int ammo_shells;
-.int ammo_nails;
-.int ammo_rockets;
-.int ammo_cells;
-.int ammo_plasma;
-.int ammo_fuel;
-.int ammo_none;
-#endif
-
 /** fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" */
 CLASS(Weapon, Object)
        ATTRIB(Weapon, m_id, int, 0);
index 3231277647dc21a3f8216117228ab0a8fbed787c..19f9ebf404426be0080aa8e389821860a431a54c 100644 (file)
@@ -1,5 +1,7 @@
 #include "quake2.qh"
 
+#include <common/items/_mod.qh>
+
 //***********************
 //QUAKE 2 ENTITIES - So people can play quake2 maps with the xonotic weapons
 //***********************
index 4c3b1d221ea4ae73be7f0ff7cc7b7ed5d7b9000f..08a4a726bd54ab0b47362c79d69fe178dd302f8f 100644 (file)
@@ -1,6 +1,5 @@
 #pragma once
 
-float warmup_limit;
 #include <common/weapons/_all.qh>
 #include <common/stats.qh>
 
index 6a0593282ff0beb973973c32d469107ed6fefaef..23124730fab631094b82938f07048d7d79d52886 100644 (file)
@@ -5,9 +5,8 @@
 /// game items.
 /// \copyright GNU GPLv2 or any later version.
 
-#include <common/mutators/mutator/instagib/sv_instagib.qh>
-#include <common/mutators/mutator/overkill/hmg.qh>
-#include <common/mutators/mutator/overkill/rpc.qh>
+#include "g_subs.qh"
+#include <common/weapons/all.qh>
 
 .bool m_isloot; ///< Holds whether item is loot.
 
index f7e30136551f5a5d98467e5dc0c4a8bc7dc43a09..6544336d9137e0e9bc03fcc5b0e3a42196cb3736 100644 (file)
@@ -3,8 +3,6 @@
 /// \brief Header file that describes the functions related to game items.
 /// \copyright GNU GPLv2 or any later version.
 
-#pragma once
-
 /// \brief Creates a new item.
 /// \param[in] class_name Class name of the item.
 /// \param[in] position Position of the item.