Monsters: #undef IMPLEMENTATION
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 27 Aug 2016 01:49:25 +0000 (11:49 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 27 Aug 2016 01:49:25 +0000 (11:49 +1000)
32 files changed:
qcsrc/common/_all.inc
qcsrc/common/animdecide.qc
qcsrc/common/mapinfo.qc
qcsrc/common/monsters/_all.inc [deleted file]
qcsrc/common/monsters/_all.qh [deleted file]
qcsrc/common/monsters/_mod.inc
qcsrc/common/monsters/_mod.qh
qcsrc/common/monsters/all.qc
qcsrc/common/monsters/all.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/spawn.qc [deleted file]
qcsrc/common/monsters/spawn.qh [deleted file]
qcsrc/common/monsters/sv_spawn.qc [new file with mode: 0644]
qcsrc/common/monsters/sv_spawn.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/all.qc
qcsrc/server/cheats.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/getreplies.qc
qcsrc/server/g_world.qc
qcsrc/server/item_key.qc
qcsrc/server/mutators/gamemode.qh
qcsrc/server/mutators/mutator.qh
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/weapons/weaponsystem.qc

index f528eee..5177c9d 100644 (file)
@@ -43,7 +43,7 @@ float autocvar_net_connecttimeout = 30;
 
 #include "items/_mod.inc"
     #include "weapons/_all.inc"
-        #include "monsters/all.qc"
+        #include "monsters/_mod.inc"
         #include "turrets/all.qc"
         #include "vehicles/all.qc"
 
index ab38927..b53a9ba 100644 (file)
@@ -1,6 +1,6 @@
 #include "animdecide.qh"
 
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 
 #if defined(SVQC)
     #include "util.qh"
index f321352..47104bb 100644 (file)
@@ -6,7 +6,7 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
     #include "util.qh"
-    #include <common/monsters/all.qh>
+    #include <common/monsters/_mod.qh>
 #endif
 
 // generic string stuff
diff --git a/qcsrc/common/monsters/_all.inc b/qcsrc/common/monsters/_all.inc
deleted file mode 100644 (file)
index 8bc63f7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "_all.qh"
-#include "_mod.inc"
diff --git a/qcsrc/common/monsters/_all.qh b/qcsrc/common/monsters/_all.qh
deleted file mode 100644 (file)
index 947026d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-#include "_mod.qh"
index 0478f09..be50e55 100644 (file)
@@ -1,6 +1,10 @@
 // generated file; do not modify
 #include <common/monsters/all.qc>
-#include <common/monsters/spawn.qc>
 #ifdef SVQC
     #include <common/monsters/sv_monsters.qc>
 #endif
+#ifdef SVQC
+    #include <common/monsters/sv_spawn.qc>
+#endif
+
+#include <common/monsters/monster/_mod.inc>
index 39d594e..55204bd 100644 (file)
@@ -1,6 +1,10 @@
 // generated file; do not modify
 #include <common/monsters/all.qh>
-#include <common/monsters/spawn.qh>
 #ifdef SVQC
     #include <common/monsters/sv_monsters.qh>
 #endif
+#ifdef SVQC
+    #include <common/monsters/sv_spawn.qh>
+#endif
+
+#include <common/monsters/monster/_mod.qh>
index a262a23..9dc09ca 100644 (file)
@@ -1,6 +1,4 @@
 #include "all.qh"
-#ifndef MONSTERS_ALL_C
-#define MONSTERS_ALL_C
 
 string M_Model(string m_mdl)
 {
@@ -12,16 +10,3 @@ string M_Model(string m_mdl)
        return output;
 #endif
 }
-
-#include "all.qh"
-
-#define IMPLEMENTATION
-#include "monster/_mod.inc"
-#undef IMPLEMENTATION
-
-#ifdef SVQC
-#include "spawn.qc"
-#include "sv_monsters.qc"
-#endif
-
-#endif
index 84f7a0d..89b5591 100644 (file)
@@ -14,6 +14,3 @@ const int MON_FIRST = 1;
 #define REGISTER_MONSTER(id, inst) REGISTER(Monsters, MON, id, monsterid, inst)
 
 REGISTER_MONSTER(Null, NEW(Monster));
-
-
-#include "monster/_mod.inc"
index 628f3e5..30d0980 100644 (file)
@@ -1,7 +1,5 @@
 #include "mage.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 SOUND(MageSpike_FIRE, W_Sound("electro_fire"));
@@ -475,5 +473,3 @@ METHOD(Mage, mr_precache, bool(Mage this))
     return true;
 }
 #endif
-
-#endif
index 1abe2e9..8f84bdc 100644 (file)
@@ -1,7 +1,5 @@
 #include "shambler.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 float autocvar_g_monster_shambler_health;
 float autocvar_g_monster_shambler_damageforcescale = 0.1;
@@ -274,5 +272,3 @@ METHOD(Shambler, mr_precache, bool(Shambler this))
     return true;
 }
 #endif
-
-#endif
index 4a0c29a..d2cb831 100644 (file)
@@ -1,7 +1,5 @@
 #include "spider.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 .float spider_slowness; // effect time of slowness inflicted by spiders
@@ -252,5 +250,3 @@ METHOD(Spider, mr_precache, bool(Spider this))
     return true;
 }
 #endif
-
-#endif
index a05b462..3fd7ec9 100644 (file)
@@ -1,7 +1,5 @@
 #include "wyvern.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_monster_wyvern_attack_fireball_damage;
@@ -173,5 +171,3 @@ METHOD(Wyvern, mr_precache, bool(Wyvern this))
     return true;
 }
 #endif
-
-#endif
index 3f43ea0..c48c210 100644 (file)
@@ -1,7 +1,5 @@
 #include "zombie.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 float autocvar_g_monster_zombie_health;
 float autocvar_g_monster_zombie_damageforcescale = 0.55;
@@ -210,5 +208,3 @@ METHOD(Zombie, mr_precache, bool(Zombie this))
     return true;
 }
 #endif
-
-#endif
diff --git a/qcsrc/common/monsters/spawn.qc b/qcsrc/common/monsters/spawn.qc
deleted file mode 100644 (file)
index 6c72ada..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "spawn.qh"
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "../util.qh"
-    #include "all.qh"
-    #include "sv_monsters.qh"
-    #include "spawn.qh"
-    #include <server/autocvars.qh>
-    #include <server/defs.qh>
-#endif
-entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag)
-{
-       float i;
-       entity e = spawn();
-
-       e.spawnflags = MONSTERFLAG_SPAWNED;
-
-       if(!respwn) { e.spawnflags |= MONSTERFLAG_NORESPAWN; }
-       if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; }
-
-       setorigin(e, orig);
-
-       if(monster == "random")
-       {
-               RandomSelection_Init();
-               for(i = MON_FIRST; i <= MON_LAST; ++i)
-                       RandomSelection_Add(NULL, i, string_null, 1, 1);
-
-           monster_id = RandomSelection_chosen_float;
-       }
-       else if(monster != "")
-       {
-               float found = 0;
-               entity mon;
-               for(i = MON_FIRST; i <= MON_LAST; ++i)
-               {
-                       mon = get_monsterinfo(i);
-                       if(mon.netname == monster)
-                       {
-                               found = true;
-                               monster_id = mon.monsterid; // we have the monster, old monster id is no longer required
-                               break;
-                       }
-               }
-               if(!found)
-                       monster_id = ((monster_id > 0) ? monster_id : MON_FIRST);
-       }
-
-       e.realowner = spawnedby;
-
-       if(moveflag)
-               e.monster_moveflags = moveflag;
-
-       if(IS_PLAYER(spawnedby))
-       {
-               if(teamplay && autocvar_g_monsters_teams)
-                       e.team = spawnedby.team; // colors handled in spawn code
-
-               if(autocvar_g_monsters_owners)
-                       e.monster_follow = own; // using .owner makes the monster non-solid for its master
-
-               e.angles_y = spawnedby.angles_y;
-       }
-
-       // Monster_Spawn checks if monster is valid
-       Monster_Spawn(e, monster_id);
-
-       return e;
-}
diff --git a/qcsrc/common/monsters/spawn.qh b/qcsrc/common/monsters/spawn.qh
deleted file mode 100644 (file)
index 0aba5c1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#pragma once
-
-entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag);
diff --git a/qcsrc/common/monsters/sv_spawn.qc b/qcsrc/common/monsters/sv_spawn.qc
new file mode 100644 (file)
index 0000000..50373cc
--- /dev/null
@@ -0,0 +1,69 @@
+#include "sv_spawn.qh"
+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+    #include "../util.qh"
+    #include "all.qh"
+    #include "sv_monsters.qh"
+    #include <server/autocvars.qh>
+    #include <server/defs.qh>
+#endif
+entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag)
+{
+       float i;
+       entity e = spawn();
+
+       e.spawnflags = MONSTERFLAG_SPAWNED;
+
+       if(!respwn) { e.spawnflags |= MONSTERFLAG_NORESPAWN; }
+       if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; }
+
+       setorigin(e, orig);
+
+       if(monster == "random")
+       {
+               RandomSelection_Init();
+               for(i = MON_FIRST; i <= MON_LAST; ++i)
+                       RandomSelection_Add(NULL, i, string_null, 1, 1);
+
+           monster_id = RandomSelection_chosen_float;
+       }
+       else if(monster != "")
+       {
+               float found = 0;
+               entity mon;
+               for(i = MON_FIRST; i <= MON_LAST; ++i)
+               {
+                       mon = get_monsterinfo(i);
+                       if(mon.netname == monster)
+                       {
+                               found = true;
+                               monster_id = mon.monsterid; // we have the monster, old monster id is no longer required
+                               break;
+                       }
+               }
+               if(!found)
+                       monster_id = ((monster_id > 0) ? monster_id : MON_FIRST);
+       }
+
+       e.realowner = spawnedby;
+
+       if(moveflag)
+               e.monster_moveflags = moveflag;
+
+       if(IS_PLAYER(spawnedby))
+       {
+               if(teamplay && autocvar_g_monsters_teams)
+                       e.team = spawnedby.team; // colors handled in spawn code
+
+               if(autocvar_g_monsters_owners)
+                       e.monster_follow = own; // using .owner makes the monster non-solid for its master
+
+               e.angles_y = spawnedby.angles_y;
+       }
+
+       // Monster_Spawn checks if monster is valid
+       Monster_Spawn(e, monster_id);
+
+       return e;
+}
diff --git a/qcsrc/common/monsters/sv_spawn.qh b/qcsrc/common/monsters/sv_spawn.qh
new file mode 100644 (file)
index 0000000..0aba5c1
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag);
index c811469..c4e73d2 100644 (file)
@@ -146,7 +146,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 #ifdef SVQC
 
 #include <common/gamemodes/_mod.qh>
-#include <common/monsters/spawn.qh>
+#include <common/monsters/sv_spawn.qh>
 #include <common/monsters/sv_monsters.qh>
 #include <server/g_subs.qh>
 
index 6e4b05a..8a44466 100644 (file)
@@ -18,7 +18,7 @@
        #include "triggers/subs.qh"
     #include "util.qh"
 
-    #include <common/monsters/all.qh>
+    #include <common/monsters/_mod.qh>
 
     #include <common/weapons/_all.qh>
 
index dfdbd76..cf55aa6 100644 (file)
@@ -27,7 +27,7 @@
     #include "../stats.qh"
     #include "../teams.qh"
     #include "../util.qh"
-    #include "../monsters/all.qh"
+    #include "../monsters/_mod.qh"
     #include "config.qh"
     #include <server/weapons/csqcprojectile.qh>
     #include <server/weapons/tracing.qh>
index 185fe8f..9f763a8 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <common/physics/player.qh>
 
-#include "../common/monsters/all.qh"
+#include "../common/monsters/_mod.qh"
 
 #include <common/weapons/_all.qh>
 
index e23f9bc..ce65924 100644 (file)
@@ -30,8 +30,8 @@
 
 #include <common/minigames/sv_minigames.qh>
 
-#include <common/monsters/all.qc>
-#include <common/monsters/spawn.qh>
+#include <common/monsters/_mod.qh>
+#include <common/monsters/sv_spawn.qh>
 #include <common/monsters/sv_monsters.qh>
 
 #include <lib/warpzone/common.qh>
index 357a33e..35418a0 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "../scores.qh"
 
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
 #include <lib/warpzone/common.qh>
 
index 7fbbddf..978a92b 100644 (file)
@@ -19,7 +19,7 @@ STATIC_INIT(COMMON_COMMANDS_aliases) {
 }
 
 #include "vote.qh"
-#include <common/monsters/spawn.qh>
+#include <common/monsters/sv_spawn.qh>
 
 #include <common/command/_mod.qh>
 
index 2598724..9380fc4 100644 (file)
@@ -8,7 +8,7 @@
 #include <common/mapinfo.qh>
 #include <common/util.qh>
 
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 
 // =========================================================
 //  Reply messages for common commands, re-worked by Samual
index 89e205c..8e8afde 100644 (file)
@@ -21,7 +21,7 @@
 #include "../common/constants.qh"
 #include "../common/deathtypes/all.qh"
 #include "../common/mapinfo.qh"
-#include "../common/monsters/all.qh"
+#include "../common/monsters/_mod.qh"
 #include "../common/monsters/sv_monsters.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/notifications/all.qh"
index 0517224..d33fe87 100644 (file)
@@ -1,7 +1,7 @@
 #include "item_key.qh"
 
 #include "../common/triggers/subs.qh"
-#include "../common/monsters/all.qh"
+#include "../common/monsters/_mod.qh"
 #include "../common/notifications/all.qh"
 #include "../common/util.qh"
 #include "../lib/warpzone/util_server.qh"
index ba3e48f..9a473af 100644 (file)
@@ -21,9 +21,9 @@
 #include <common/command/_mod.qh>
 #include <common/net_notice.qh>
 #include <common/animdecide.qh>
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 #include <common/monsters/sv_monsters.qh>
-#include <common/monsters/spawn.qh>
+#include <common/monsters/sv_spawn.qh>
 #include <common/weapons/config.qh>
 #include <common/weapons/_all.qh>
 #include <server/weapons/accuracy.qh>
@@ -81,7 +81,7 @@
 
 #include <server/command/_mod.qh>
 
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 
 #include <server/weapons/tracing.qh>
 #include <server/weapons/weaponsystem.qh>
index 9c13e1b..e051cd6 100644 (file)
@@ -27,7 +27,7 @@
 #include <common/stats.qh>
 #include <common/teams.qh>
 
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 
 #include <lib/warpzone/anglestransform.qh>
 #include <lib/warpzone/server.qh>
index d43d504..66cd022 100644 (file)
@@ -1,6 +1,6 @@
 #include "gamemode_invasion.qh"
 
-#include <common/monsters/spawn.qh>
+#include <common/monsters/sv_spawn.qh>
 #include <common/monsters/sv_monsters.qh>
 
 #include <server/teamplay.qh>
index 13f32ee..2a6cd03 100644 (file)
@@ -8,7 +8,7 @@
 #include <common/t_items.qh>
 #include <common/animdecide.qh>
 #include <common/constants.qh>
-#include <common/monsters/all.qh>
+#include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
 #include <common/util.qh>
 #include <common/weapons/_all.qh>