From a97b89297fa91ae42b9d56c262662eb34ede3e45 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 8 Oct 2015 22:35:21 +1100 Subject: [PATCH] Revert "Merge branch 'TimePath/bot_api' into 'master' " This reverts commit a39af09cb4b15ec94461af2c1f314098ffe7ce0c, reversing changes made to 81b0f2bc5760bb652515453ac450f2822a98b725. --- 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/physics.qc | 4 - qcsrc/common/triggers/func/breakable.qc | 1 + qcsrc/common/turrets/turret/walker.qc | 2 +- qcsrc/common/weapons/all.qh | 4 + qcsrc/dpdefs/csprogsdefs.qh | 2 - qcsrc/server/autocvars.qh | 62 ++++++++++++ qcsrc/server/bot/{default => }/aim.qc | 5 + qcsrc/server/bot/{default => }/aim.qh | 0 qcsrc/server/bot/api.qh | 96 ------------------- qcsrc/server/bot/{default => }/bot.qc | 30 +++++- qcsrc/server/bot/{default => }/bot.qh | 9 ++ qcsrc/server/bot/default/all.inc | 11 --- qcsrc/server/bot/default/defs.qh | 61 ------------ .../bot/{default => }/havocbot/havocbot.qc | 13 +++ .../bot/{default => }/havocbot/havocbot.qh | 0 .../{default => }/havocbot/role_keyhunt.qc | 8 ++ .../{default => }/havocbot/role_keyhunt.qh | 3 + .../bot/{default => }/havocbot/roles.qc | 8 +- .../bot/{default => }/havocbot/roles.qh | 0 qcsrc/server/bot/havocbot/scripting.qh | 5 + qcsrc/server/bot/impl.qc | 5 - qcsrc/server/bot/lib/all.inc | 10 -- qcsrc/server/bot/lib/movelib/all.inc | 1 - qcsrc/server/bot/lib/pathlib/all.inc | 6 -- qcsrc/server/bot/lib/steerlib/all.inc | 1 - qcsrc/server/bot/{default => }/navigation.qc | 9 +- qcsrc/server/bot/{default => }/navigation.qh | 0 qcsrc/server/bot/null/impl.qc | 39 -------- qcsrc/server/bot/{default => }/scripting.qc | 5 +- qcsrc/server/bot/{default => }/scripting.qh | 1 - qcsrc/server/bot/{default => }/waypoints.qc | 10 ++ qcsrc/server/bot/{default => }/waypoints.qh | 19 ++-- qcsrc/server/cl_client.qc | 3 +- qcsrc/server/cl_impulse.qc | 3 + qcsrc/server/cl_player.qc | 1 + qcsrc/server/command/sv_cmd.qc | 4 + qcsrc/server/defs.qh | 1 + qcsrc/server/g_world.qc | 1 + qcsrc/server/{bot/lib/movelib => }/movelib.qc | 0 qcsrc/server/{bot/lib/movelib => }/movelib.qh | 0 qcsrc/server/mutators/gamemode.qh | 8 ++ qcsrc/server/mutators/gamemode_assault.qh | 3 + qcsrc/server/mutators/gamemode_keyhunt.qc | 2 +- qcsrc/server/mutators/gamemode_nexball.qc | 2 - qcsrc/server/mutators/mutator.qh | 8 ++ qcsrc/server/mutators/mutators_include.qc | 1 + qcsrc/server/{bot/lib => }/pathlib/costs.qc | 4 +- qcsrc/server/{bot/lib => }/pathlib/debug.qc | 0 .../{bot/lib => }/pathlib/expandnode.qc | 0 qcsrc/server/{bot/lib => }/pathlib/main.qc | 3 + qcsrc/server/{bot/lib => }/pathlib/main.qh | 0 .../server/{bot/lib => }/pathlib/movenode.qc | 2 + .../{bot/lib => }/pathlib/path_waypoint.qc | 2 + 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/progs.inc | 26 +++-- qcsrc/server/race.qc | 2 + .../server/{bot/lib/steerlib => }/steerlib.qc | 7 ++ .../server/{bot/lib/steerlib => }/steerlib.qh | 0 qcsrc/server/sv_main.qc | 3 + qcsrc/server/t_items.qc | 3 + qcsrc/server/teamplay.qc | 2 + 68 files changed, 260 insertions(+), 268 deletions(-) create mode 100644 qcsrc/client/movelib.qc create mode 100644 qcsrc/client/movelib.qh rename qcsrc/server/bot/{default => }/aim.qc (99%) rename qcsrc/server/bot/{default => }/aim.qh (100%) delete mode 100644 qcsrc/server/bot/api.qh rename qcsrc/server/bot/{default => }/bot.qc (95%) rename qcsrc/server/bot/{default => }/bot.qh (90%) delete mode 100644 qcsrc/server/bot/default/all.inc delete mode 100644 qcsrc/server/bot/default/defs.qh rename qcsrc/server/bot/{default => }/havocbot/havocbot.qc (99%) rename qcsrc/server/bot/{default => }/havocbot/havocbot.qh (100%) rename qcsrc/server/bot/{default => }/havocbot/role_keyhunt.qc (97%) rename qcsrc/server/bot/{default => }/havocbot/role_keyhunt.qh (62%) rename qcsrc/server/bot/{default => }/havocbot/roles.qc (98%) rename qcsrc/server/bot/{default => }/havocbot/roles.qh (100%) create mode 100644 qcsrc/server/bot/havocbot/scripting.qh delete mode 100644 qcsrc/server/bot/impl.qc delete mode 100644 qcsrc/server/bot/lib/all.inc delete mode 100644 qcsrc/server/bot/lib/movelib/all.inc delete mode 100644 qcsrc/server/bot/lib/pathlib/all.inc delete mode 100644 qcsrc/server/bot/lib/steerlib/all.inc rename qcsrc/server/bot/{default => }/navigation.qc (99%) rename qcsrc/server/bot/{default => }/navigation.qh (100%) delete mode 100644 qcsrc/server/bot/null/impl.qc rename qcsrc/server/bot/{default => }/scripting.qc (99%) rename qcsrc/server/bot/{default => }/scripting.qh (98%) rename qcsrc/server/bot/{default => }/waypoints.qc (99%) rename qcsrc/server/bot/{default => }/waypoints.qh (80%) rename qcsrc/server/{bot/lib/movelib => }/movelib.qc (100%) rename qcsrc/server/{bot/lib/movelib => }/movelib.qh (100%) 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 (99%) 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%) 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 new file mode 100644 index 000000000..074f146dc --- /dev/null +++ b/qcsrc/client/movelib.qc @@ -0,0 +1 @@ +#include "../server/movelib.qc" diff --git a/qcsrc/client/movelib.qh b/qcsrc/client/movelib.qh new file mode 100644 index 000000000..a0634f6de --- /dev/null +++ b/qcsrc/client/movelib.qh @@ -0,0 +1 @@ +#include "../server/movelib.qh" diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index 4a10ef196..ec5c31844 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -19,6 +19,7 @@ #include "mapvoting.qc" #include "miscfunctions.qc" #include "modeleffects.qc" +#include "movelib.qc" #include "particles.qc" #include "player_skeleton.qc" #include "rubble.qc" @@ -50,8 +51,6 @@ #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 05f466621..8425a123a 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -27,7 +27,6 @@ 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 75837cf1a..8b05f781d 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -14,6 +14,7 @@ #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/physics.qc b/qcsrc/common/physics.qc index 6d6322611..1a799c8de 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -1109,8 +1109,6 @@ void PM_check_frozen(void) } } -.float ladder_time; - void PM_check_hitground() {SELFPARAM(); #ifdef SVQC @@ -1302,8 +1300,6 @@ void PM_swim(float maxspd_mod) PM_ClientMovement_Move(); } -.entity ladder_entity; - void PM_ladder(float maxspd_mod) {SELFPARAM(); // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index e6253b14d..af9a6b423 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -4,6 +4,7 @@ #include "../../../server/g_subs.qh" #include "../../../server/g_damage.qh" +#include "../../../server/bot/bot.qh" #include "../../../common/csqcmodel_settings.qh" #include "../../../csqcmodellib/sv_model.qh" #include "../../../server/weapons/common.qh" diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index 4a5ed2fc8..e629ada79 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 "../../../server/bot/lib/movelib/movelib.qh" +#include "../../../client/movelib.qh" void walker_draw(entity this) { diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index faea45b5f..c96061fe6 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -26,6 +26,10 @@ WepSet ReadWepSet(); #include "../util.qh" +#ifdef SVQC +#include "../../server/bot/aim.qh" +#endif + REGISTRY(Weapons, 72) // Increase as needed. Can be up to 72. REGISTER_REGISTRY(RegisterWeapons) entity get_weaponinfo(int id); diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index 0daa5dce3..6ad27242a 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -23,8 +23,6 @@ #undef particleeffectnum #undef setmodel -entity(.entity fld, entity match) findchainentity = #403; - #pragma noref 0 #define ReadFloat() ReadCoord() diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 6a2ff9d4c..affd9437e 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -7,6 +7,63 @@ bool autocvar__campaign_testrun; int autocvar__campaign_index; string autocvar__campaign_name; bool autocvar__sv_init; +float autocvar_bot_ai_aimskill_blendrate; +float autocvar_bot_ai_aimskill_firetolerance_distdegrees; +float autocvar_bot_ai_aimskill_firetolerance_maxdegrees; +float autocvar_bot_ai_aimskill_firetolerance_mindegrees; +float autocvar_bot_ai_aimskill_fixedrate; +float autocvar_bot_ai_aimskill_mouse; +float autocvar_bot_ai_aimskill_offset; +float autocvar_bot_ai_aimskill_order_filter_1st; +float autocvar_bot_ai_aimskill_order_filter_2nd; +float autocvar_bot_ai_aimskill_order_filter_3th; +float autocvar_bot_ai_aimskill_order_filter_4th; +float autocvar_bot_ai_aimskill_order_filter_5th; +float autocvar_bot_ai_aimskill_order_mix_1st; +float autocvar_bot_ai_aimskill_order_mix_2nd; +float autocvar_bot_ai_aimskill_order_mix_3th; +float autocvar_bot_ai_aimskill_order_mix_4th; +float autocvar_bot_ai_aimskill_order_mix_5th; +float autocvar_bot_ai_aimskill_think; +float autocvar_bot_ai_bunnyhop_firstjumpdelay; +float autocvar_bot_ai_bunnyhop_skilloffset; +float autocvar_bot_ai_bunnyhop_startdistance; +float autocvar_bot_ai_bunnyhop_stopdistance; +float autocvar_bot_ai_chooseweaponinterval; +string autocvar_bot_ai_custom_weapon_priority_close; +string autocvar_bot_ai_custom_weapon_priority_distances; +string autocvar_bot_ai_custom_weapon_priority_far; +string autocvar_bot_ai_custom_weapon_priority_mid; +float autocvar_bot_ai_dangerdetectioninterval; +float autocvar_bot_ai_dangerdetectionupdates; +float autocvar_bot_ai_enemydetectioninterval; +float autocvar_bot_ai_enemydetectionradius; +float autocvar_bot_ai_friends_aware_pickup_radius; +float autocvar_bot_ai_ignoregoal_timeout; +float autocvar_bot_ai_keyboard_distance; +float autocvar_bot_ai_keyboard_threshold; +float autocvar_bot_ai_navigation_jetpack; +float autocvar_bot_ai_navigation_jetpack_mindistance; +float autocvar_bot_ai_strategyinterval; +float autocvar_bot_ai_thinkinterval; +bool autocvar_bot_ai_weapon_combo; +float autocvar_bot_ai_weapon_combo_threshold; +string autocvar_bot_config_file; +bool autocvar_bot_god; +bool autocvar_bot_ignore_bots; +bool autocvar_bot_join_empty; +bool autocvar_bot_navigation_ignoreplayers; +bool autocvar_bot_nofire; +#define autocvar_bot_number cvar("bot_number") +#define autocvar_bot_prefix cvar_string("bot_prefix") +bool autocvar_bot_sound_monopoly; +#define autocvar_bot_suffix cvar_string("bot_suffix") +bool autocvar_bot_usemodelnames; +int autocvar_bot_vs_human; +int autocvar_bot_debug; +bool autocvar_bot_debug_tracewalk; +bool autocvar_bot_debug_goalstack; +bool autocvar_bot_wander_enable; int autocvar_captureleadlimit_override; #define autocvar_capturelimit_override cvar("capturelimit_override") #define autocvar_developer cvar("developer") @@ -236,6 +293,7 @@ float autocvar_g_ctf_dropped_capture_delay; float autocvar_g_ctf_dropped_capture_radius; float autocvar_g_cts_finish_kill_delay; bool autocvar_g_cts_selfdamage; +bool autocvar_g_debug_bot_commands; int autocvar_g_domination_default_teams; bool autocvar_g_domination_disable_frags; int autocvar_g_domination_point_amt; @@ -444,6 +502,7 @@ float autocvar_g_turrets_targetscan_maxdelay; float autocvar_g_turrets_targetscan_mindelay; bool autocvar_g_use_ammunition; bool autocvar_g_waypointeditor; +int autocvar_g_waypointeditor_auto; bool autocvar_g_waypoints_for_items; float autocvar_g_weapon_charge_colormod_blue_full; float autocvar_g_weapon_charge_colormod_blue_half; @@ -475,6 +534,7 @@ int autocvar_rescan_pending; bool autocvar_samelevel; string autocvar_sessionid; #define autocvar_skill cvar("skill") +float autocvar_skill_auto; #define autocvar_slowmo cvar("slowmo") float autocvar_snd_soundradius; int autocvar_spawn_debug; @@ -524,6 +584,7 @@ float autocvar_sv_itemstime; string autocvar_sv_jumpspeedcap_max; float autocvar_sv_jumpspeedcap_max_disable_on_ramps; string autocvar_sv_jumpspeedcap_min; +float autocvar_sv_jumpvelocity; bool autocvar_sv_logscores_bots; bool autocvar_sv_logscores_console; bool autocvar_sv_logscores_file; @@ -591,6 +652,7 @@ float autocvar_timelimit_overtime; int autocvar_timelimit_overtimes; float autocvar_timelimit_suddendeath; #define autocvar_utf8_enable cvar("utf8_enable") +bool autocvar_waypoint_benchmark; float autocvar_sv_gameplayfix_gravityunaffectedbyticrate; bool autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag; float autocvar_g_trueaim_minrange; diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/aim.qc similarity index 99% rename from qcsrc/server/bot/default/aim.qc rename to qcsrc/server/bot/aim.qc index 6353d1ee3..4f750cdb4 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -1,4 +1,9 @@ #include "aim.qh" +#include "../_all.qh" + +#include "bot.qh" + +#include "../mutators/mutators_include.qh" // traces multiple trajectories to find one that will impact the target // 'end' vector is the place it aims for, diff --git a/qcsrc/server/bot/default/aim.qh b/qcsrc/server/bot/aim.qh similarity index 100% rename from qcsrc/server/bot/default/aim.qh rename to qcsrc/server/bot/aim.qh diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh deleted file mode 100644 index 9dc20ebb3..000000000 --- a/qcsrc/server/bot/api.qh +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef BOT_API_H -#define BOT_API_H - -#include "../defs.qh" -#include "../autocvars.qh" -#include "../../common/weapons/all.qh" -#include "../../common/teams.qh" -#include "../teamplay.qh" -#include "../miscfunctions.qh" -#include "../campaign.qh" -#include "../cl_client.qh" -#include "../mutators/mutators_include.qh" -#include "../constants.qh" -#include "../weapons/weaponsystem.qh" - -const int WAYPOINTFLAG_GENERATED = 0x800000; - -int autocvar_bot_vs_human; -int autocvar_bot_number; -bool autocvar_bot_sound_monopoly; -float autocvar_bot_ai_strategyinterval; - -float bot_custom_weapon; -float bot_weapons_close[Weapons_MAX]; -float bot_weapons_far[Weapons_MAX]; -float bot_weapons_mid[Weapons_MAX]; -float currentbots; -float skill; - -.float bot_attack; -.float bot_dodgerating; -.float bot_dodge; -.float bot_forced_team; -.float bot_moveskill; // moving technique -.float bot_pickup; -.float(entity player, entity item) bot_pickupevalfunc; -.float bot_strategytime; -.string cleanname; -.float havocbot_role_timeout; -.float isbot; // true if this client is actually a bot -.float lastteleporttime; -.float navigation_hasgoals; -.float nearestwaypointtimeout; -.entity nearestwaypoint; -.float speed; -.entity wp00, wp01, wp02, wp03, wp04, wp05, wp06, wp07, wp08, wp09, wp10, wp11, wp12, wp13, wp14, wp15; -.entity wp16, wp17, wp18, wp19, wp20, wp21, wp22, wp23, wp24, wp25, wp26, wp27, wp28, wp29, wp30, wp31; -.float wp00mincost, wp01mincost, wp02mincost, wp03mincost, wp04mincost, wp05mincost, wp06mincost, wp07mincost; -.float wp08mincost, wp09mincost, wp10mincost, wp11mincost, wp12mincost, wp13mincost, wp14mincost, wp15mincost; -.float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost; -.float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost; -.float wpconsidered; -.float wpcost; -.int wpflags; - -bool bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity); -void bot_clientconnect(); -void bot_clientdisconnect(); -void bot_cmdhelp(string scmd); -void bot_endgame(); -bool bot_fixcount(); -void bot_list_commands(); -void bot_queuecommand(entity bot, string cmdstring); -void bot_relinkplayerlist(); -void bot_resetqueues(); -void bot_serverframe(); -bool bot_shouldattack(entity e); -void bot_think(); - -entity find_bot_by_name(string name); -entity find_bot_by_number(float number); - -void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius); -void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius); -void havocbot_goalrating_items(float ratingscale, vector org, float sradius); - -entity navigation_findnearestwaypoint(entity ent, float walkfromwp); -void navigation_goalrating_end(); -void navigation_goalrating_start(); -void navigation_markroutes(entity fixed_source_waypoint); -void navigation_markroutes_inverted(entity fixed_source_waypoint); -void navigation_routerating(entity e, float f, float rangebias); - -bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode); - -void waypoint_remove(entity e); -void waypoint_saveall(); -void waypoint_schedulerelinkall(); -void waypoint_schedulerelink(entity wp); -void waypoint_spawnforitem(entity e); -void waypoint_spawnforitem_force(entity e, vector org); -void waypoint_spawnforteleporter(entity e, vector destination, float timetaken); -void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken); -entity waypoint_spawn(vector m1, vector m2, float f); - -#endif diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/bot.qc similarity index 95% rename from qcsrc/server/bot/default/bot.qc rename to qcsrc/server/bot/bot.qc index 7eb438ec8..00051cadb 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -1,4 +1,5 @@ #include "bot.qh" +#include "../_all.qh" #include "aim.qh" #include "navigation.qh" @@ -6,8 +7,35 @@ #include "waypoints.qh" #include "havocbot/havocbot.qh" +#include "havocbot/scripting.qh" -#include "../../weapons/accuracy.qh" +#include "../antilag.qh" +#include "../autocvars.qh" +#include "../campaign.qh" +#include "../cl_client.qh" +#include "../constants.qh" +#include "../defs.qh" +#include "../race.qh" +#include "../t_items.qh" + +#include "../mutators/mutators_include.qh" + +#include "../weapons/accuracy.qh" + +#include "../../common/constants.qh" +#include "../../common/mapinfo.qh" +#include "../../common/teams.qh" +#include "../../common/util.qh" + +#include "../../common/weapons/all.qh" + +#include "../../csqcmodellib/sv_model.qh" + +#include "../../dpdefs/dpextensions.qh" +#include "../../dpdefs/progsdefs.qh" + +#include "../../warpzonelib/common.qh" +#include "../../warpzonelib/util_server.qh" entity bot_spawn() {SELFPARAM(); diff --git a/qcsrc/server/bot/default/bot.qh b/qcsrc/server/bot/bot.qh similarity index 90% rename from qcsrc/server/bot/default/bot.qh rename to qcsrc/server/bot/bot.qh index b3c628de1..d5a279400 100644 --- a/qcsrc/server/bot/default/bot.qh +++ b/qcsrc/server/bot/bot.qh @@ -21,6 +21,7 @@ const int AI_STATUS_STUCK = 2048; // Cannot reach any goal .int aistatus; // Skill system +float skill; float autoskill_nextthink; // havocbot_keyboardskill // keyboard movement @@ -42,7 +43,14 @@ float autoskill_nextthink; .float totalfrags_lastcheck; +// Custom weapon priorities +float bot_custom_weapon; +float bot_distance_far; +float bot_distance_close; +float bot_weapons_far[Weapons_MAX]; +float bot_weapons_mid[Weapons_MAX]; +float bot_weapons_close[Weapons_MAX]; entity bot_list; entity player_list; @@ -76,6 +84,7 @@ float botframe_spawnedwaypoints; float botframe_nextthink; float botframe_nextdangertime; float bot_cvar_nextthink; +float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay) /* * Functions diff --git a/qcsrc/server/bot/default/all.inc b/qcsrc/server/bot/default/all.inc deleted file mode 100644 index a613a3918..000000000 --- a/qcsrc/server/bot/default/all.inc +++ /dev/null @@ -1,11 +0,0 @@ -#include "defs.qh" - -#include "bot.qc" -#include "aim.qc" -#include "navigation.qc" -#include "scripting.qc" -#include "waypoints.qc" - -#include "havocbot/havocbot.qc" -#include "havocbot/role_keyhunt.qc" -#include "havocbot/roles.qc" diff --git a/qcsrc/server/bot/default/defs.qh b/qcsrc/server/bot/default/defs.qh deleted file mode 100644 index 2d7c49975..000000000 --- a/qcsrc/server/bot/default/defs.qh +++ /dev/null @@ -1,61 +0,0 @@ -float bot_distance_close; -float bot_distance_far; -float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay) - -int autocvar_g_waypointeditor_auto; -float autocvar_skill_auto; -float autocvar_sv_jumpvelocity; -bool autocvar_waypoint_benchmark; -bool autocvar_bot_god; -float autocvar_bot_ai_thinkinterval; -float autocvar_bot_ai_aimskill_blendrate; -float autocvar_bot_ai_aimskill_firetolerance_distdegrees; -float autocvar_bot_ai_aimskill_firetolerance_maxdegrees; -float autocvar_bot_ai_aimskill_firetolerance_mindegrees; -float autocvar_bot_ai_aimskill_fixedrate; -float autocvar_bot_ai_aimskill_mouse; -float autocvar_bot_ai_aimskill_offset; -float autocvar_bot_ai_aimskill_order_filter_1st; -float autocvar_bot_ai_aimskill_order_filter_2nd; -float autocvar_bot_ai_aimskill_order_filter_3th; -float autocvar_bot_ai_aimskill_order_filter_4th; -float autocvar_bot_ai_aimskill_order_filter_5th; -float autocvar_bot_ai_aimskill_order_mix_1st; -float autocvar_bot_ai_aimskill_order_mix_2nd; -float autocvar_bot_ai_aimskill_order_mix_3th; -float autocvar_bot_ai_aimskill_order_mix_4th; -float autocvar_bot_ai_aimskill_order_mix_5th; -float autocvar_bot_ai_aimskill_think; -float autocvar_bot_ai_bunnyhop_firstjumpdelay; -float autocvar_bot_ai_bunnyhop_skilloffset; -float autocvar_bot_ai_bunnyhop_startdistance; -float autocvar_bot_ai_bunnyhop_stopdistance; -float autocvar_bot_ai_chooseweaponinterval; -string autocvar_bot_ai_custom_weapon_priority_close; -string autocvar_bot_ai_custom_weapon_priority_distances; -string autocvar_bot_ai_custom_weapon_priority_far; -string autocvar_bot_ai_custom_weapon_priority_mid; -float autocvar_bot_ai_dangerdetectioninterval; -float autocvar_bot_ai_dangerdetectionupdates; -float autocvar_bot_ai_enemydetectioninterval; -float autocvar_bot_ai_enemydetectionradius; -float autocvar_bot_ai_friends_aware_pickup_radius; -float autocvar_bot_ai_ignoregoal_timeout; -float autocvar_bot_ai_keyboard_distance; -float autocvar_bot_ai_keyboard_threshold; -float autocvar_bot_ai_navigation_jetpack; -float autocvar_bot_ai_navigation_jetpack_mindistance; -bool autocvar_bot_ai_weapon_combo; -float autocvar_bot_ai_weapon_combo_threshold; -string autocvar_bot_config_file; -bool autocvar_bot_ignore_bots; -bool autocvar_bot_join_empty; -bool autocvar_bot_navigation_ignoreplayers; -bool autocvar_bot_nofire; -#define autocvar_bot_prefix cvar_string("bot_prefix") -#define autocvar_bot_suffix cvar_string("bot_suffix") -bool autocvar_bot_usemodelnames; -int autocvar_bot_debug; -bool autocvar_bot_debug_tracewalk; -bool autocvar_bot_debug_goalstack; -bool autocvar_bot_wander_enable; diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc similarity index 99% rename from qcsrc/server/bot/default/havocbot/havocbot.qc rename to qcsrc/server/bot/havocbot/havocbot.qc index ae5314a8c..f69527916 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -1,4 +1,17 @@ #include "havocbot.qh" +#include "../../_all.qh" + +#include "../aim.qh" +#include "../bot.qh" +#include "../navigation.qh" +#include "../scripting.qh" +#include "../waypoints.qh" + +#include "../../../common/constants.qh" + +#include "../../../common/triggers/trigger/jumppads.qh" + +#include "../../../warpzonelib/common.qh" void havocbot_ai() {SELFPARAM(); diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qh b/qcsrc/server/bot/havocbot/havocbot.qh similarity index 100% rename from qcsrc/server/bot/default/havocbot/havocbot.qh rename to qcsrc/server/bot/havocbot/havocbot.qh diff --git a/qcsrc/server/bot/default/havocbot/role_keyhunt.qc b/qcsrc/server/bot/havocbot/role_keyhunt.qc similarity index 97% rename from qcsrc/server/bot/default/havocbot/role_keyhunt.qc rename to qcsrc/server/bot/havocbot/role_keyhunt.qc index a26068581..b1603c792 100644 --- a/qcsrc/server/bot/default/havocbot/role_keyhunt.qc +++ b/qcsrc/server/bot/havocbot/role_keyhunt.qc @@ -1,4 +1,12 @@ #include "role_keyhunt.qh" +#include "../../_all.qh" + +#include "havocbot.qh" + +#include "../bot.qh" +#include "../navigation.qh" + +#include "../../mutators/mutators_include.qh" void() havocbot_role_kh_carrier; void() havocbot_role_kh_defense; diff --git a/qcsrc/server/bot/default/havocbot/role_keyhunt.qh b/qcsrc/server/bot/havocbot/role_keyhunt.qh similarity index 62% rename from qcsrc/server/bot/default/havocbot/role_keyhunt.qh rename to qcsrc/server/bot/havocbot/role_keyhunt.qh index ac3c77e52..f3136c630 100644 --- a/qcsrc/server/bot/default/havocbot/role_keyhunt.qh +++ b/qcsrc/server/bot/havocbot/role_keyhunt.qh @@ -1,5 +1,8 @@ #ifndef ROLE_KEYHUNT_H #define ROLE_KEYHUNT_H +entity kh_worldkeylist; +.entity kh_worldkeynext; + void havocbot_chooserole_kh(); #endif diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc similarity index 98% rename from qcsrc/server/bot/default/havocbot/roles.qc rename to qcsrc/server/bot/havocbot/roles.qc index c520ab3cd..037968f13 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -1,4 +1,10 @@ -#include "roles.qh" +#include "../../_all.qh" + +#include "havocbot.qh" +#include "role_keyhunt.qh" + +#include "../bot.qh" +#include "../navigation.qh" .float max_armorvalue; .float havocbot_role_timeout; diff --git a/qcsrc/server/bot/default/havocbot/roles.qh b/qcsrc/server/bot/havocbot/roles.qh similarity index 100% rename from qcsrc/server/bot/default/havocbot/roles.qh rename to qcsrc/server/bot/havocbot/roles.qh diff --git a/qcsrc/server/bot/havocbot/scripting.qh b/qcsrc/server/bot/havocbot/scripting.qh new file mode 100644 index 000000000..c09dbdeac --- /dev/null +++ b/qcsrc/server/bot/havocbot/scripting.qh @@ -0,0 +1,5 @@ +#ifndef HAVOCBOT_SCRIPTING_H +#define HAVOCBOT_SCRIPTING_H + +void bot_clearqueue(entity bot); +#endif diff --git a/qcsrc/server/bot/impl.qc b/qcsrc/server/bot/impl.qc deleted file mode 100644 index c0b6c8716..000000000 --- a/qcsrc/server/bot/impl.qc +++ /dev/null @@ -1,5 +0,0 @@ -#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 deleted file mode 100644 index 9a92a9616..000000000 --- a/qcsrc/server/bot/lib/all.inc +++ /dev/null @@ -1,10 +0,0 @@ -#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 deleted file mode 100644 index c12ce90ef..000000000 --- a/qcsrc/server/bot/lib/movelib/all.inc +++ /dev/null @@ -1 +0,0 @@ -#include "movelib.qc" diff --git a/qcsrc/server/bot/lib/pathlib/all.inc b/qcsrc/server/bot/lib/pathlib/all.inc deleted file mode 100644 index 8622734d0..000000000 --- a/qcsrc/server/bot/lib/pathlib/all.inc +++ /dev/null @@ -1,6 +0,0 @@ -#include "costs.qc" -#include "expandnode.qc" -#include "main.qc" -#include "movenode.qc" -#include "path_waypoint.qc" -#include "utility.qc" diff --git a/qcsrc/server/bot/lib/steerlib/all.inc b/qcsrc/server/bot/lib/steerlib/all.inc deleted file mode 100644 index 9e802b586..000000000 --- a/qcsrc/server/bot/lib/steerlib/all.inc +++ /dev/null @@ -1 +0,0 @@ -#include "steerlib.qc" diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/navigation.qc similarity index 99% rename from qcsrc/server/bot/default/navigation.qc rename to qcsrc/server/bot/navigation.qc index 8898b7163..99e3901b2 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -1,6 +1,13 @@ #include "navigation.qh" +#include "../_all.qh" -#include "../../../common/triggers/trigger/jumppads.qh" +#include "bot.qh" +#include "waypoints.qh" + +#include "../t_items.qh" + +#include "../../common/constants.qh" +#include "../../common/triggers/trigger/jumppads.qh" void bot_debug(string input) { diff --git a/qcsrc/server/bot/default/navigation.qh b/qcsrc/server/bot/navigation.qh similarity index 100% rename from qcsrc/server/bot/default/navigation.qh rename to qcsrc/server/bot/navigation.qh diff --git a/qcsrc/server/bot/null/impl.qc b/qcsrc/server/bot/null/impl.qc deleted file mode 100644 index ea35b7fbc..000000000 --- a/qcsrc/server/bot/null/impl.qc +++ /dev/null @@ -1,39 +0,0 @@ -bool bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity) { return false; } -void bot_clientconnect() { } -void bot_clientdisconnect() { } -void bot_cmdhelp(string scmd) { } -void bot_endgame() { } -bool bot_fixcount() { return true; } -void bot_list_commands() { } -void bot_queuecommand(entity bot, string cmdstring) { } -void bot_relinkplayerlist() { } -void bot_resetqueues() { } -void bot_serverframe() { } -bool bot_shouldattack(entity e) { return false; } -void bot_think() { } - -entity find_bot_by_name(string name) { return NULL; } -entity find_bot_by_number(float number) { return NULL; } - -void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius) { } -void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius) { } -void havocbot_goalrating_items(float ratingscale, vector org, float sradius) { } - -entity navigation_findnearestwaypoint(entity ent, float walkfromwp) { return NULL; } -void navigation_goalrating_end() { } -void navigation_goalrating_start() { } -void navigation_markroutes(entity fixed_source_waypoint) { } -void navigation_markroutes_inverted(entity fixed_source_waypoint) { } -void navigation_routerating(entity e, float f, float rangebias) { } - -bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode) { return false; } - -void waypoint_remove(entity e) { } -void waypoint_saveall() { } -void waypoint_schedulerelinkall() { } -void waypoint_schedulerelink(entity wp) { } -void waypoint_spawnforitem(entity e) { } -void waypoint_spawnforitem_force(entity e, vector org) { } -void waypoint_spawnforteleporter(entity e, vector destination, float timetaken) { } -void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken) { } -entity waypoint_spawn(vector m1, vector m2, float f) { return NULL; } diff --git a/qcsrc/server/bot/default/scripting.qc b/qcsrc/server/bot/scripting.qc similarity index 99% rename from qcsrc/server/bot/default/scripting.qc rename to qcsrc/server/bot/scripting.qc index 3f53d2b9f..72951cd66 100644 --- a/qcsrc/server/bot/default/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1,4 +1,7 @@ #include "scripting.qh" +#include "../_all.qh" + +#include "bot.qh" .float bot_cmdqueuebuf_allocated; .float bot_cmdqueuebuf; @@ -1165,8 +1168,6 @@ void bot_resetqueues() bot_barriertime = time; } -bool autocvar_g_debug_bot_commands; - // Here we map commands to functions and deal with complex interactions between commands and execution states // NOTE: Of course you need to include your commands here too :) float bot_execute_commands_once() diff --git a/qcsrc/server/bot/default/scripting.qh b/qcsrc/server/bot/scripting.qh similarity index 98% rename from qcsrc/server/bot/default/scripting.qh rename to qcsrc/server/bot/scripting.qh index 1f2d4da31..d5cdda9d6 100644 --- a/qcsrc/server/bot/default/scripting.qh +++ b/qcsrc/server/bot/scripting.qh @@ -9,7 +9,6 @@ #define CMD_STATUS_FINISHED 1 #define CMD_STATUS_ERROR 2 -void bot_clearqueue(entity bot); // NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER const int BOT_CMD_NULL = 0; diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/waypoints.qc similarity index 99% rename from qcsrc/server/bot/default/waypoints.qc rename to qcsrc/server/bot/waypoints.qc index 25031ef34..8f50d0276 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -1,4 +1,14 @@ #include "waypoints.qh" +#include "../_all.qh" + +#include "bot.qh" +#include "navigation.qh" + +#include "../antilag.qh" + +#include "../../common/constants.qh" + +#include "../../warpzonelib/util_server.qh" // create a new spawnfunc_waypoint and automatically link it to other waypoints, and link // them back to it as well diff --git a/qcsrc/server/bot/default/waypoints.qh b/qcsrc/server/bot/waypoints.qh similarity index 80% rename from qcsrc/server/bot/default/waypoints.qh rename to qcsrc/server/bot/waypoints.qh index 42082c6ab..fde524bb9 100644 --- a/qcsrc/server/bot/default/waypoints.qh +++ b/qcsrc/server/bot/waypoints.qh @@ -3,14 +3,15 @@ /* * Globals and Fields */ -// const int WAYPOINTFLAG_GENERATED = 0x800000; -const int WAYPOINTFLAG_ITEM = 0x400000; -const int WAYPOINTFLAG_TELEPORT = 0x200000; -const int WAYPOINTFLAG_NORELINK = 0x100000; -const int WAYPOINTFLAG_PERSONAL = 0x80000; -const int WAYPOINTFLAG_PROTECTED = 0x40000; // Useless WP detection never kills these. -const int WAYPOINTFLAG_USEFUL = 0x20000; // Useless WP detection temporary flag. -const int WAYPOINTFLAG_DEAD_END = 0x10000; // Useless WP detection temporary flag. + +const int WAYPOINTFLAG_GENERATED = 8388608; +const int WAYPOINTFLAG_ITEM = 4194304; +const int WAYPOINTFLAG_TELEPORT = 2097152; +const int WAYPOINTFLAG_NORELINK = 1048576; +const int WAYPOINTFLAG_PERSONAL = 524288; +const int WAYPOINTFLAG_PROTECTED = 262144; // Useless WP detection never kills these. +const int WAYPOINTFLAG_USEFUL = 131072; // Useless WP detection temporary flag. +const int WAYPOINTFLAG_DEAD_END = 65536; // Useless WP detection temporary flag. // fields you can query using prvm_global server to get some statistics about waypoint linking culling float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled; @@ -28,7 +29,7 @@ float botframe_cachedwaypointlinks; .float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost; .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost; -.float wpfire, wpconsidered, wpisbox, wplinked, wphardwired; +.float wpfire, wpcost, wpconsidered, wpisbox, wplinked, wphardwired; .int wpflags; .vector wpnearestpoint; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index adf2542cb..71efa5f9d 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -20,7 +20,8 @@ #include "campaign.qh" #include "command/common.qh" -#include "bot/api.qh" +#include "bot/bot.qh" +#include "bot/navigation.qh" #include "../common/vehicles/all.qh" diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 178902375..a594c83c7 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -1,9 +1,12 @@ #include "_all.qh" #include "round_handler.qh" +#include "bot/waypoints.qh" + #include "weapons/throwing.qh" #include "command/common.qh" #include "cheats.qh" +#include "bot/navigation.qh" #include "weapons/selection.qh" #include "weapons/tracing.qh" #include "weapons/weaponsystem.qh" diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 82c456f0a..e94ba6283 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1,6 +1,7 @@ #include "cl_player.qh" #include "_all.qh" +#include "bot/bot.qh" #include "cheats.qh" #include "g_damage.qh" #include "g_subs.qh" diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 03d47c747..d08588ff9 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -17,6 +17,10 @@ #include "../playerdemo.qh" #include "../teamplay.qh" +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/scripting.qh" + #include "../mutators/mutators_include.qh" #include "../../common/constants.qh" diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 102309a08..4a7edc2b9 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -45,6 +45,7 @@ float sv_clones; float sv_foginterval; float player_count; +float currentbots; float bots_would_leave; void UpdateFrags(entity player, float f); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index b202f284f..a0f9a3f13 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -3,6 +3,7 @@ #include "anticheat.qh" #include "antilag.qh" +#include "bot/bot.qh" #include "campaign.qh" #include "cheats.qh" #include "cl_client.qh" diff --git a/qcsrc/server/bot/lib/movelib/movelib.qc b/qcsrc/server/movelib.qc similarity index 100% rename from qcsrc/server/bot/lib/movelib/movelib.qc rename to qcsrc/server/movelib.qc diff --git a/qcsrc/server/bot/lib/movelib/movelib.qh b/qcsrc/server/movelib.qh similarity index 100% rename from qcsrc/server/bot/lib/movelib/movelib.qh rename to qcsrc/server/movelib.qh diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh index 4a52ffabf..d2066b9ab 100644 --- a/qcsrc/server/mutators/gamemode.qh +++ b/qcsrc/server/mutators/gamemode.qh @@ -12,6 +12,14 @@ #include "../scores.qh" #include "../scores_rules.qh" +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/waypoints.qh" +#include "../bot/havocbot/roles.qh" +#include "../bot/havocbot/role_keyhunt.qh" + +#include "../bot/havocbot/havocbot.qh" + #include "../command/vote.qh" #include "../../common/monsters/all.qh" diff --git a/qcsrc/server/mutators/gamemode_assault.qh b/qcsrc/server/mutators/gamemode_assault.qh index 7635a9395..1266492ca 100644 --- a/qcsrc/server/mutators/gamemode_assault.qh +++ b/qcsrc/server/mutators/gamemode_assault.qh @@ -21,6 +21,9 @@ void() havocbot_role_ast_offense; void(entity bot) havocbot_ast_reset_role; +void(float ratingscale, vector org, float sradius) havocbot_goalrating_items; +void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers; + // scoreboard stuff const float ST_ASSAULT_OBJECTIVES = 1; const float SP_ASSAULT_OBJECTIVES = 4; diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index 17f2da70b..be45c3db0 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -50,7 +50,7 @@ float kh_Team_ByID(float t) return 0; } -entity kh_worldkeylist; +//entity kh_worldkeylist; .entity kh_worldkeynext; entity kh_controller; //float kh_tracking_enabled; diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index e95231ea4..f65e05843 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -3,8 +3,6 @@ #include "gamemode.qh" -#include "../../common/triggers/trigger/jumppads.qh" - float autocvar_g_nexball_basketball_bouncefactor; float autocvar_g_nexball_basketball_bouncestop; float autocvar_g_nexball_basketball_carrier_highspeed; diff --git a/qcsrc/server/mutators/mutator.qh b/qcsrc/server/mutators/mutator.qh index 70c912562..39adb175c 100644 --- a/qcsrc/server/mutators/mutator.qh +++ b/qcsrc/server/mutators/mutator.qh @@ -13,6 +13,14 @@ #include "../scores.qh" #include "../scores_rules.qh" +#include "../bot/bot.qh" +#include "../bot/navigation.qh" +#include "../bot/waypoints.qh" + +#include "../bot/havocbot/havocbot.qh" +#include "../bot/havocbot/roles.qh" +#include "../bot/havocbot/role_keyhunt.qh" + #include "../command/vote.qh" #include "../command/common.qh" diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index 67bb246b0..8564d34c5 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -70,6 +70,7 @@ #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/bot/lib/pathlib/costs.qc b/qcsrc/server/pathlib/costs.qc similarity index 98% rename from qcsrc/server/bot/lib/pathlib/costs.qc rename to qcsrc/server/pathlib/costs.qc index eb885a4f5..3e452f66e 100644 --- a/qcsrc/server/bot/lib/pathlib/costs.qc +++ b/qcsrc/server/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 = min(x,y,z); + h_diag = min3(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 = min(x,y,z); + h_diag = min3(x,y,z); h_str = x + y + z; h = pathlib_movecost_diag * h_diag; diff --git a/qcsrc/server/bot/lib/pathlib/debug.qc b/qcsrc/server/pathlib/debug.qc similarity index 100% rename from qcsrc/server/bot/lib/pathlib/debug.qc rename to qcsrc/server/pathlib/debug.qc diff --git a/qcsrc/server/bot/lib/pathlib/expandnode.qc b/qcsrc/server/pathlib/expandnode.qc similarity index 100% rename from qcsrc/server/bot/lib/pathlib/expandnode.qc rename to qcsrc/server/pathlib/expandnode.qc diff --git a/qcsrc/server/bot/lib/pathlib/main.qc b/qcsrc/server/pathlib/main.qc similarity index 99% rename from qcsrc/server/bot/lib/pathlib/main.qc rename to qcsrc/server/pathlib/main.qc index 39e23bd0b..f097e8a0f 100644 --- a/qcsrc/server/bot/lib/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -1,5 +1,8 @@ +#include "../_all.qh" + #include "pathlib.qh" #include "utility.qh" +#include "../command/common.qh" void pathlib_deletepath(entity start) { diff --git a/qcsrc/server/bot/lib/pathlib/main.qh b/qcsrc/server/pathlib/main.qh similarity index 100% rename from qcsrc/server/bot/lib/pathlib/main.qh rename to qcsrc/server/pathlib/main.qh diff --git a/qcsrc/server/bot/lib/pathlib/movenode.qc b/qcsrc/server/pathlib/movenode.qc similarity index 99% rename from qcsrc/server/bot/lib/pathlib/movenode.qc rename to qcsrc/server/pathlib/movenode.qc index 5326a746d..6645d7126 100644 --- a/qcsrc/server/bot/lib/pathlib/movenode.qc +++ b/qcsrc/server/pathlib/movenode.qc @@ -1,3 +1,5 @@ +#include "../_all.qh" + #include "pathlib.qh" #include "utility.qh" diff --git a/qcsrc/server/bot/lib/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc similarity index 99% rename from qcsrc/server/bot/lib/pathlib/path_waypoint.qc rename to qcsrc/server/pathlib/path_waypoint.qc index 615840d51..4c3a7a1aa 100644 --- a/qcsrc/server/bot/lib/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -1,3 +1,5 @@ +#include "../bot/waypoints.qh" + #include "pathlib.qh" #include "main.qh" diff --git a/qcsrc/server/bot/lib/pathlib/pathlib.qh b/qcsrc/server/pathlib/pathlib.qh similarity index 100% rename from qcsrc/server/bot/lib/pathlib/pathlib.qh rename to qcsrc/server/pathlib/pathlib.qh diff --git a/qcsrc/server/bot/lib/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc similarity index 100% rename from qcsrc/server/bot/lib/pathlib/utility.qc rename to qcsrc/server/pathlib/utility.qc diff --git a/qcsrc/server/bot/lib/pathlib/utility.qh b/qcsrc/server/pathlib/utility.qh similarity index 100% rename from qcsrc/server/bot/lib/pathlib/utility.qh rename to qcsrc/server/pathlib/utility.qh diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index ad1e855e5..adb8cf632 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -7,8 +7,6 @@ #include "../lib/_all.inc" -#include "bot/lib/steerlib/steerlib.qh" - #include "anticheat.qc" #include "antilag.qc" #include "campaign.qc" @@ -31,6 +29,7 @@ #include "item_key.qc" #include "mapvoting.qc" #include "miscfunctions.qc" +#include "movelib.qc" #include "playerdemo.qc" #include "portals.qc" #include "race.qc" @@ -38,21 +37,36 @@ #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" #include "t_quake.qc" +#include "bot/aim.qc" +#include "bot/bot.qc" +#include "bot/navigation.qc" +#include "bot/scripting.qc" +#include "bot/waypoints.qc" + +#include "bot/havocbot/havocbot.qc" +#include "bot/havocbot/role_keyhunt.qc" +#include "bot/havocbot/roles.qc" + #include "command/all.qc" #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 @@ -106,8 +120,6 @@ #include "../warpzonelib/server.qc" #include "../warpzonelib/util_server.qc" -#include "bot/impl.qc" - #if BUILD_MOD #include "../../mod/server/progs.inc" #endif diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 4c451caa7..fbf1eaa18 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -5,6 +5,8 @@ #include "portals.qh" #include "scores.qh" #include "spawnpoints.qh" +#include "bot/waypoints.qh" +#include "bot/navigation.qh" #include "command/getreplies.qh" #include "../common/deathtypes.qh" #include "../common/notifications.qh" diff --git a/qcsrc/server/bot/lib/steerlib/steerlib.qc b/qcsrc/server/steerlib.qc similarity index 99% rename from qcsrc/server/bot/lib/steerlib/steerlib.qc rename to qcsrc/server/steerlib.qc index 23b847373..fbf84da32 100644 --- a/qcsrc/server/bot/lib/steerlib/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -1,3 +1,10 @@ +#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/bot/lib/steerlib/steerlib.qh b/qcsrc/server/steerlib.qh similarity index 100% rename from qcsrc/server/bot/lib/steerlib/steerlib.qh rename to qcsrc/server/steerlib.qh diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 9dfd6b807..138051827 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -4,6 +4,9 @@ #include "g_hook.qh" #include "g_world.qh" +#include "bot/bot.qh" +#include "bot/waypoints.qh" + #include "command/common.qh" #include "mutators/mutators_include.qh" diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 964b05e1b..0a5785037 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -5,6 +5,9 @@ #if defined(SVQC) #include "_all.qh" + #include "bot/bot.qh" + #include "bot/waypoints.qh" + #include "mutators/mutators_include.qh" #include "weapons/common.qh" diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 35a764c56..2fbbd50b3 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -6,6 +6,8 @@ #include "scores.qh" #include "scores_rules.qh" +#include "bot/bot.qh" + #include "command/vote.qh" #include "mutators/mutators_include.qh" -- 2.39.2