From dd3c7bd110ff27b62d6c8ee82cd25f51fc4b5a49 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 8 Oct 2015 10:56:13 +1100 Subject: [PATCH] Bots: move supporting code into bot directory --- qcsrc/client/movelib.qc | 1 - qcsrc/client/movelib.qh | 1 - qcsrc/client/progs.inc | 3 ++- qcsrc/common/monsters/monster/zombie.qc | 1 + qcsrc/common/monsters/sv_monsters.qc | 1 - qcsrc/common/turrets/turret/walker.qc | 2 +- qcsrc/dpdefs/csprogsdefs.qh | 2 ++ qcsrc/server/bot/default/navigation.qc | 2 +- qcsrc/server/bot/impl.qc | 2 ++ qcsrc/server/bot/lib/all.inc | 10 ++++++++++ qcsrc/server/bot/lib/movelib/all.inc | 1 + qcsrc/server/{ => bot/lib/movelib}/movelib.qc | 0 qcsrc/server/{ => bot/lib/movelib}/movelib.qh | 0 qcsrc/server/bot/lib/pathlib/all.inc | 6 ++++++ qcsrc/server/{ => bot/lib}/pathlib/costs.qc | 4 ++-- qcsrc/server/{ => bot/lib}/pathlib/debug.qc | 0 qcsrc/server/{ => bot/lib}/pathlib/expandnode.qc | 0 qcsrc/server/{ => bot/lib}/pathlib/main.qc | 3 --- qcsrc/server/{ => bot/lib}/pathlib/main.qh | 0 qcsrc/server/{ => bot/lib}/pathlib/movenode.qc | 2 -- .../server/{ => bot/lib}/pathlib/path_waypoint.qc | 0 qcsrc/server/{ => bot/lib}/pathlib/pathlib.qh | 0 qcsrc/server/{ => bot/lib}/pathlib/utility.qc | 0 qcsrc/server/{ => bot/lib}/pathlib/utility.qh | 0 qcsrc/server/bot/lib/steerlib/all.inc | 1 + qcsrc/server/{ => bot/lib/steerlib}/steerlib.qc | 7 ------- qcsrc/server/{ => bot/lib/steerlib}/steerlib.qh | 0 qcsrc/server/mutators/mutators_include.qc | 1 - qcsrc/server/progs.inc | 14 +++++--------- 29 files changed, 34 insertions(+), 30 deletions(-) delete mode 100644 qcsrc/client/movelib.qc delete mode 100644 qcsrc/client/movelib.qh create mode 100644 qcsrc/server/bot/lib/all.inc create mode 100644 qcsrc/server/bot/lib/movelib/all.inc rename qcsrc/server/{ => bot/lib/movelib}/movelib.qc (100%) rename qcsrc/server/{ => bot/lib/movelib}/movelib.qh (100%) create mode 100644 qcsrc/server/bot/lib/pathlib/all.inc rename qcsrc/server/{ => bot/lib}/pathlib/costs.qc (98%) rename qcsrc/server/{ => bot/lib}/pathlib/debug.qc (100%) rename qcsrc/server/{ => bot/lib}/pathlib/expandnode.qc (100%) rename qcsrc/server/{ => bot/lib}/pathlib/main.qc (99%) rename qcsrc/server/{ => bot/lib}/pathlib/main.qh (100%) rename qcsrc/server/{ => bot/lib}/pathlib/movenode.qc (99%) rename qcsrc/server/{ => bot/lib}/pathlib/path_waypoint.qc (100%) rename qcsrc/server/{ => bot/lib}/pathlib/pathlib.qh (100%) rename qcsrc/server/{ => bot/lib}/pathlib/utility.qc (100%) rename qcsrc/server/{ => bot/lib}/pathlib/utility.qh (100%) create mode 100644 qcsrc/server/bot/lib/steerlib/all.inc rename qcsrc/server/{ => bot/lib/steerlib}/steerlib.qc (99%) rename qcsrc/server/{ => bot/lib/steerlib}/steerlib.qh (100%) diff --git a/qcsrc/client/movelib.qc b/qcsrc/client/movelib.qc deleted file mode 100644 index 074f146dc..000000000 --- a/qcsrc/client/movelib.qc +++ /dev/null @@ -1 +0,0 @@ -#include "../server/movelib.qc" diff --git a/qcsrc/client/movelib.qh b/qcsrc/client/movelib.qh deleted file mode 100644 index a0634f6de..000000000 --- a/qcsrc/client/movelib.qh +++ /dev/null @@ -1 +0,0 @@ -#include "../server/movelib.qh" diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index ec5c31844..4a10ef196 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -19,7 +19,6 @@ #include "mapvoting.qc" #include "miscfunctions.qc" #include "modeleffects.qc" -#include "movelib.qc" #include "particles.qc" #include "player_skeleton.qc" #include "rubble.qc" @@ -51,6 +50,8 @@ #include "../common/minigames/minigames.qc" #include "../common/minigames/cl_minigames.qc" +#include "../server/bot/lib/all.inc" + #include "../common/buffs/all.qc" #include "../common/items/all.qc" #include "../common/monsters/all.qc" diff --git a/qcsrc/common/monsters/monster/zombie.qc b/qcsrc/common/monsters/monster/zombie.qc index 8425a123a..05f466621 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -27,6 +27,7 @@ REGISTER_MONSTER(ZOMBIE, NEW(Zombie)) { #ifdef IMPLEMENTATION #ifdef SVQC +#include "../../../server/bot/lib/movelib/movelib.qh" float autocvar_g_monster_zombie_health; float autocvar_g_monster_zombie_damageforcescale = 0.55; float autocvar_g_monster_zombie_attack_melee_damage; diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 8b05f781d..75837cf1a 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -14,7 +14,6 @@ #include "../../server/defs.qh" #include "../deathtypes.qh" #include "../../server/mutators/mutators_include.qh" - #include "../../server/steerlib.qh" #include "../turrets/sv_turrets.qh" #include "../turrets/util.qh" #include "../vehicles/all.qh" diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index e629ada79..4a5ed2fc8 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -631,7 +631,7 @@ spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER)) remove(self); } #endif // SVQC #ifdef CSQC -#include "../../../client/movelib.qh" +#include "../../../server/bot/lib/movelib/movelib.qh" void walker_draw(entity this) { diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index 6ad27242a..0daa5dce3 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -23,6 +23,8 @@ #undef particleeffectnum #undef setmodel +entity(.entity fld, entity match) findchainentity = #403; + #pragma noref 0 #define ReadFloat() ReadCoord() diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index fb196fcc3..8898b7163 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1,6 +1,6 @@ #include "navigation.qh" -#include "../common/triggers/trigger/jumppads.qh" +#include "../../../common/triggers/trigger/jumppads.qh" void bot_debug(string input) { diff --git a/qcsrc/server/bot/impl.qc b/qcsrc/server/bot/impl.qc index 9f36c4f67..c0b6c8716 100644 --- a/qcsrc/server/bot/impl.qc +++ b/qcsrc/server/bot/impl.qc @@ -1,3 +1,5 @@ #include "api.qh" +#include "lib/all.inc" + #include "default/all.inc" diff --git a/qcsrc/server/bot/lib/all.inc b/qcsrc/server/bot/lib/all.inc new file mode 100644 index 000000000..9a92a9616 --- /dev/null +++ b/qcsrc/server/bot/lib/all.inc @@ -0,0 +1,10 @@ +#ifndef BOT_LIB_ALL_H +#define BOT_LIB_ALL_H + +#include "movelib/all.inc" +#ifdef SVQC +#include "pathlib/all.inc" +#endif +#include "steerlib/all.inc" + +#endif diff --git a/qcsrc/server/bot/lib/movelib/all.inc b/qcsrc/server/bot/lib/movelib/all.inc new file mode 100644 index 000000000..c12ce90ef --- /dev/null +++ b/qcsrc/server/bot/lib/movelib/all.inc @@ -0,0 +1 @@ +#include "movelib.qc" diff --git a/qcsrc/server/movelib.qc b/qcsrc/server/bot/lib/movelib/movelib.qc similarity index 100% rename from qcsrc/server/movelib.qc rename to qcsrc/server/bot/lib/movelib/movelib.qc diff --git a/qcsrc/server/movelib.qh b/qcsrc/server/bot/lib/movelib/movelib.qh similarity index 100% rename from qcsrc/server/movelib.qh rename to qcsrc/server/bot/lib/movelib/movelib.qh diff --git a/qcsrc/server/bot/lib/pathlib/all.inc b/qcsrc/server/bot/lib/pathlib/all.inc new file mode 100644 index 000000000..8622734d0 --- /dev/null +++ b/qcsrc/server/bot/lib/pathlib/all.inc @@ -0,0 +1,6 @@ +#include "costs.qc" +#include "expandnode.qc" +#include "main.qc" +#include "movenode.qc" +#include "path_waypoint.qc" +#include "utility.qc" diff --git a/qcsrc/server/pathlib/costs.qc b/qcsrc/server/bot/lib/pathlib/costs.qc similarity index 98% rename from qcsrc/server/pathlib/costs.qc rename to qcsrc/server/bot/lib/pathlib/costs.qc index 3e452f66e..eb885a4f5 100644 --- a/qcsrc/server/pathlib/costs.qc +++ b/qcsrc/server/bot/lib/pathlib/costs.qc @@ -111,7 +111,7 @@ float pathlib_h_diagonal2sdp(vector preprev,vector prev,vector point,vector end) y = fabs(point.y - end.y); z = fabs(point.z - end.z); - h_diag = min3(x,y,z); + h_diag = min(x,y,z); h_str = x + y + z; h = pathlib_movecost_diag * h_diag; @@ -136,7 +136,7 @@ float pathlib_h_diagonal3(vector a,vector b) y = fabs(a.y - b.y); z = fabs(a.z - b.z); - h_diag = min3(x,y,z); + h_diag = min(x,y,z); h_str = x + y + z; h = pathlib_movecost_diag * h_diag; diff --git a/qcsrc/server/pathlib/debug.qc b/qcsrc/server/bot/lib/pathlib/debug.qc similarity index 100% rename from qcsrc/server/pathlib/debug.qc rename to qcsrc/server/bot/lib/pathlib/debug.qc diff --git a/qcsrc/server/pathlib/expandnode.qc b/qcsrc/server/bot/lib/pathlib/expandnode.qc similarity index 100% rename from qcsrc/server/pathlib/expandnode.qc rename to qcsrc/server/bot/lib/pathlib/expandnode.qc diff --git a/qcsrc/server/pathlib/main.qc b/qcsrc/server/bot/lib/pathlib/main.qc similarity index 99% rename from qcsrc/server/pathlib/main.qc rename to qcsrc/server/bot/lib/pathlib/main.qc index f097e8a0f..39e23bd0b 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/bot/lib/pathlib/main.qc @@ -1,8 +1,5 @@ -#include "../_all.qh" - #include "pathlib.qh" #include "utility.qh" -#include "../command/common.qh" void pathlib_deletepath(entity start) { diff --git a/qcsrc/server/pathlib/main.qh b/qcsrc/server/bot/lib/pathlib/main.qh similarity index 100% rename from qcsrc/server/pathlib/main.qh rename to qcsrc/server/bot/lib/pathlib/main.qh diff --git a/qcsrc/server/pathlib/movenode.qc b/qcsrc/server/bot/lib/pathlib/movenode.qc similarity index 99% rename from qcsrc/server/pathlib/movenode.qc rename to qcsrc/server/bot/lib/pathlib/movenode.qc index 6645d7126..5326a746d 100644 --- a/qcsrc/server/pathlib/movenode.qc +++ b/qcsrc/server/bot/lib/pathlib/movenode.qc @@ -1,5 +1,3 @@ -#include "../_all.qh" - #include "pathlib.qh" #include "utility.qh" diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/bot/lib/pathlib/path_waypoint.qc similarity index 100% rename from qcsrc/server/pathlib/path_waypoint.qc rename to qcsrc/server/bot/lib/pathlib/path_waypoint.qc diff --git a/qcsrc/server/pathlib/pathlib.qh b/qcsrc/server/bot/lib/pathlib/pathlib.qh similarity index 100% rename from qcsrc/server/pathlib/pathlib.qh rename to qcsrc/server/bot/lib/pathlib/pathlib.qh diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/bot/lib/pathlib/utility.qc similarity index 100% rename from qcsrc/server/pathlib/utility.qc rename to qcsrc/server/bot/lib/pathlib/utility.qc diff --git a/qcsrc/server/pathlib/utility.qh b/qcsrc/server/bot/lib/pathlib/utility.qh similarity index 100% rename from qcsrc/server/pathlib/utility.qh rename to qcsrc/server/bot/lib/pathlib/utility.qh diff --git a/qcsrc/server/bot/lib/steerlib/all.inc b/qcsrc/server/bot/lib/steerlib/all.inc new file mode 100644 index 000000000..9e802b586 --- /dev/null +++ b/qcsrc/server/bot/lib/steerlib/all.inc @@ -0,0 +1 @@ +#include "steerlib.qc" diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/bot/lib/steerlib/steerlib.qc similarity index 99% rename from qcsrc/server/steerlib.qc rename to qcsrc/server/bot/lib/steerlib/steerlib.qc index fbf84da32..23b847373 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/bot/lib/steerlib/steerlib.qc @@ -1,10 +1,3 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" -#endif - /** Uniform pull towards a point **/ diff --git a/qcsrc/server/steerlib.qh b/qcsrc/server/bot/lib/steerlib/steerlib.qh similarity index 100% rename from qcsrc/server/steerlib.qh rename to qcsrc/server/bot/lib/steerlib/steerlib.qh diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index 8564d34c5..67bb246b0 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -70,7 +70,6 @@ #include "../playerdemo.qh" #include "../round_handler.qh" #include "../item_key.qh" - #include "../pathlib/pathlib.qh" #include "../../common/vehicles/all.qh" #endif diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 75c00833f..ad1e855e5 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -7,6 +7,8 @@ #include "../lib/_all.inc" +#include "bot/lib/steerlib/steerlib.qh" + #include "anticheat.qc" #include "antilag.qc" #include "campaign.qc" @@ -29,7 +31,6 @@ #include "item_key.qc" #include "mapvoting.qc" #include "miscfunctions.qc" -#include "movelib.qc" #include "playerdemo.qc" #include "portals.qc" #include "race.qc" @@ -37,9 +38,11 @@ #include "scores.qc" #include "scores_rules.qc" #include "spawnpoints.qc" -#include "steerlib.qc" #include "sv_main.qc" #include "teamplay.qc" + +#include "bot/lib/all.inc" + #include "t_halflife.qc" #include "t_items.qc" #include "t_quake3.qc" @@ -50,13 +53,6 @@ #include "mutators/mutators_include.qc" #include "mutators/mutators.qc" -#include "pathlib/costs.qc" -#include "pathlib/expandnode.qc" -#include "pathlib/main.qc" -#include "pathlib/movenode.qc" -#include "pathlib/path_waypoint.qc" -#include "pathlib/utility.qc" - #include "weapons/accuracy.qc" #include "weapons/common.qc" #include "weapons/csqcprojectile.qc" // TODO -- 2.39.2