]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 f528eee6db46aab5a426d78d60739db50ae83f7d..5177c9dfd17320b7a3bc4dfa577639a608637ba8 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 ab389278d16fcd696d850af106c59947b4108da6..b53a9ba0e9cbf6123d7438736785e8206200358a 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 f3213527ba48167611a8f842e45af3738e9dad85..47104bb2dc42f1c7765282806859324e4c3ef2cb 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 0478f09eec10f3bfcddac8995a4b3b14f9be81e9..be50e5503f70f2d660263fd15f68c98aa991bd40 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 39d594e4c5c99c40e70dc7d70eb3243dbaf9cfce..55204bd1a770ec46b66e48222b6d0ae3fcbf62e7 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 a262a234505008acf2d80c49b0617bd947695ce2..9dc09ca394b47166bc4d717901d0aa17f6465664 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 84f7a0d78f6d19d4121334681655c170e19f2569..89b5591b4d5ff9ce3daf20aeb847a04d21726fb0 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 628f3e5eaa71f474a6bb070cd047becf405e6051..30d09807f2f9faf9c4462c30b07c36bb117983e9 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 1abe2e9c8700af6156ce8bbcfb78e87a726b4863..8f84bdce31d70778f2989c696a14198f7aa29ac5 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 4a0c29a1717fa934127a44153c01670d2c48006d..d2cb8313e3f022402353736f94ac839da415114b 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 a05b462a0e6e54ea1cde2b01519fbf4017622bf8..3fd7ec967679e05b750349427f0b2b68d6bf1a32 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 3f43ea0f092a5376494d891b0770bcc04886337a..c48c2108fa2299b80eee1aebdccf5a7da5f4d21b 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 c8114694f547bb09f82a331ee2c9c45c30111121..c4e73d286d13946e64024fc976ae1d5987e3347a 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 6e4b05a912fba0188765468b494c0b4ab5bffefb..8a44466785d1cfd8e6733d1d12948863c772bee8 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 dfdbd765665a1b09322afd0b28b62f4d6dcd8998..cf55aa65214b7a84673da155f3ffb0eece56eb36 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 185fe8fb4e0f3cf44f473f1c3526714995900a2b..9f763a886d73217cd4490aa05fba9f75a2add448 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 e23f9bc9892a70ddf649f69ee7f7725b9bc66035..ce6592408cb4a3fa50af5cf90d0a19eee5271f4a 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 357a33eba2d5d1cb398a138883ccd83b606fcca5..35418a02f07d420a9e0805f341a73cbaa6632ca5 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 7fbbddf7d799f5c7e7d100537dba926956c84a38..978a92b14f0c1fd4f6d5224f4a3610cf9caf67d9 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 2598724717a72b3b3bdf5d22fd3168895cb55fe1..9380fc4cde280f0cd9fda57a24cd6bddbd41da56 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 89e205c2b13506942f87d62a6c9c889d66d7d541..8e8afde9fd8e33d3d62359f87a1fed2c78c7ab1d 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 05172241c3e320630e3e4fc02321de3ab370c86f..d33fe87c2e1a477189000119b501b52c6f69c88e 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 ba3e48f17c1d5bba002d5c0f30e0d835ee405955..9a473affdf8bc1f8105cdbc9cef20fca5d8a1cea 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 9c13e1bb63e7393269853cafafb431d41f2ee8e4..e051cd6978dc6da2619fccfa06efc6e1ef2d61be 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 d43d504821e795aa2c2611107629dbe33416ed8b..66cd022fd67ddfaae92c3366e5d1f7d601662bb7 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 13f32ee14d2a76e9cae1ec69dea3d01b3fa4c1e9..2a6cd03a4daec752658f6f92d6107b4ea3bdd3ab 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>