--- /dev/null
+#include <client/_all.qh>
+#include "_mod.inc"
+
+#include "commands/_all.inc"
+#include "hud/_all.inc"
+#include "mutators/_all.inc"
+#include "weapons/_all.inc"
+
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
+
+#include <lib/csqcmodel/cl_model.qc>
+#include <lib/csqcmodel/cl_player.qc>
+#include <lib/csqcmodel/interpolate.qc>
+
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/client.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
#pragma once
+//#include "_mod.qh"
#include <common/util.qh>
--- /dev/null
+#include <client/commands/_all.qh>
+#include "_mod.inc"
+
+#include <common/command/_all.inc>
--- /dev/null
+#pragma once
+#include "_mod.qh"
+
+#include <common/command/_all.qh>
// generated file; do not modify
-#include <client/commands/all.qc>
#include <client/commands/cl_cmd.qc>
// generated file; do not modify
-#include <client/commands/all.qh>
#include <client/commands/cl_cmd.qh>
+++ /dev/null
-#include "all.qh"
-#include <common/command/all.qc>
+++ /dev/null
-#pragma once
-
-#include <common/command/all.qh>
-
-#include "cl_cmd.qh"
// Last updated: December 28th, 2011
// ==============================================
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "cl_cmd.qh"
#include "../autocvars.qh"
#include "../defs.qh"
-#include <client/hud/all.qh>
+#include <client/hud/_all.qh>
#include "../main.qh"
#include "../mapvoting.qh"
#include "../miscfunctions.qh"
#include <common/mapinfo.qh>
-#include <common/command/generic.qh>
-
void DrawDebugModel(entity this)
{
if (time - floor(time) > 0.5)
--- /dev/null
+#include <client/hud/_all.qh>
+#include "_mod.inc"
+
+#include "panel/_all.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
+
+#include "panel/_all.qh"
// generated file; do not modify
#include <client/hud/hud.qc>
#include <client/hud/hud_config.qc>
+#include <client/hud/panel.qc>
// generated file; do not modify
#include <client/hud/hud.qh>
#include <client/hud/hud_config.qh>
+#include <client/hud/panel.qh>
+++ /dev/null
-#include "panel/weapons.qc"
-#include "panel/ammo.qc"
-#include "panel/powerups.qc"
-#include "panel/healtharmor.qc"
-#include "panel/notify.qc"
-#include "panel/timer.qc"
-#include "panel/radar.qc"
-#include "panel/score.qc"
-#include "panel/racetimer.qc"
-#include "panel/vote.qc"
-#include "panel/modicons.qc"
-#include "panel/pressedkeys.qc"
-#include "panel/chat.qc"
-#include "panel/engineinfo.qc"
-#include "panel/infomessages.qc"
-#include "panel/physics.qc"
-#include "panel/centerprint.qc"
-#include "panel/minigame.qc"
-// #include "panel/mapvote.qc"
-// #include "panel/itemstime.qc"
-#include "panel/quickmenu.qc"
-#include "panel/scoreboard.qc"
+++ /dev/null
-#pragma once
-
-#include "hud.qh"
-#include "hud_config.qh"
#include "hud.qh"
+#include "panel/scoreboard.qh"
+
#include "hud_config.qh"
#include "../mapvoting.qh"
#include "../teamradar.qh"
DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
}
-#include "all.inc"
-
/*
==================
Main HUD system
}
}
+bool HUD_Minigame_Showpanels();
+
bool HUD_Panel_CheckFlags(int showflags)
{
TC(int, showflags);
return true;
}
+entity CSQCModel_server2csqc(int i);
void calc_followmodel_ofs(entity view);
void Hud_Dynamic_Frame()
{
--- /dev/null
+#include "panel.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include <client/hud/panel/racetimer.qc>
#include <client/hud/panel/radar.qc>
#include <client/hud/panel/score.qc>
+#include <client/hud/panel/scoreboard.qc>
#include <client/hud/panel/timer.qc>
#include <client/hud/panel/vote.qc>
#include <client/hud/panel/weapons.qc>
-#include <client/hud/panel/scoreboard.qc>
#include <client/hud/panel/racetimer.qh>
#include <client/hud/panel/radar.qh>
#include <client/hud/panel/score.qh>
+#include <client/hud/panel/scoreboard.qh>
#include <client/hud/panel/timer.qh>
#include <client/hud/panel/vote.qh>
#include <client/hud/panel/weapons.qh>
-#include <client/hud/panel/scoreboard.qh>
#pragma once
#include "../panel.qh"
+
+void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color);
#pragma once
#include "../panel.qh"
+
+void reset_centerprint_messages();
#pragma once
#include "../panel.qh"
+
+void addPowerupItem(string name, string icon, vector color, float currentTime, float lifeTime);
// QuickMenu (#23)
#include <common/ent_cs.qh>
-#include <client/hud/all.qh>
+#include <client/hud/_all.qh>
#include <client/mapvoting.qh>
// QUICKMENU_MAXLINES must be <= 10
#include "main.qh"
#include <common/effects/qc/all.qh>
-#include "hud/all.qh"
+#include "hud/_all.qh"
#include "mapvoting.qh"
#include "mutators/events.qh"
#include "hud/panel/scoreboard.qh"
#include "mapvoting.qh"
-#include "hud/all.qh"
+#include "hud/_all.qh"
#include "hud/panel/scoreboard.qh"
#include <common/mapinfo.qh>
#include "miscfunctions.qh"
-#include "hud/all.qh"
+#include "hud/_all.qh"
-#include <common/command/generic.qh>
+#include <common/command/_all.qh>
#include <common/teams.qh>
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
// generated file; do not modify
+#include <client/mutators/events.qc>
// generated file; do not modify
+#include <client/mutators/events.qh>
--- /dev/null
+#include "events.qh"
#include <lib/_all.inc>
#if XONOTIC
-
-#include "_all.qh"
-
-#include "../client/_mod.inc"
-#include "commands/_mod.inc"
-#include "hud/_mod.inc"
-#include "mutators/_mod.inc"
-#include "weapons/_mod.inc"
-
-#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
-
-#include <lib/csqcmodel/cl_model.qc>
-#include <lib/csqcmodel/cl_player.qc>
-#include <lib/csqcmodel/interpolate.qc>
-
-#include <lib/warpzone/anglestransform.qc>
-#include <lib/warpzone/common.qc>
-#include <lib/warpzone/client.qc>
-#include <lib/warpzone/server.qc>
-#include <lib/warpzone/util_server.qc>
-
+#include "_all.inc"
#endif
#include <ecs/_lib.inc>
#include "shownames.qh"
-#include "hud/all.qh"
+#include "hud/_all.qh"
#include <common/ent_cs.qh>
#include <common/constants.qh>
#include "teamradar.qh"
-#include "hud/all.qh"
+#include "hud/_all.qh"
#include <common/mutators/mutator/waypoints/all.qh>
#include "view.qh"
#include "announcer.qh"
-#include "hud/all.qh"
+#include "hud/_all.qh"
#include "mapvoting.qh"
#include "shownames.qh"
#include "hud/panel/scoreboard.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include "t_items.qc"
#endif
-#include "items/_mod.inc"
+#include "items/_all.inc"
#include "weapons/all.qc"
#include "monsters/all.qc"
#include "turrets/all.qc"
#include "vehicles/all.qc"
-#include "mutators/_mod.inc"
- #include "gamemodes/_mod.inc"
+#include "mutators/_all.inc"
+ #include "gamemodes/_all.inc"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
// generated file; do not modify
-#include <common/command/all.qc>
#include <common/command/generic.qc>
#include <common/command/markup.qc>
+#include <common/command/reg.qc>
#include <common/command/rpn.qc>
// generated file; do not modify
-#include <common/command/all.qh>
#include <common/command/generic.qh>
#include <common/command/markup.qh>
+#include <common/command/reg.qh>
#include <common/command/rpn.qh>
+++ /dev/null
-#include "generic.qc"
-#include "markup.qc"
-#include "rpn.qc"
+++ /dev/null
-#pragma once
-
-#include "command.qh"
-REGISTRY(GENERIC_COMMANDS, BITS(7))
-#define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL)
-REGISTER_REGISTRY(GENERIC_COMMANDS)
-REGISTRY_SORT(GENERIC_COMMANDS)
-
-#define GENERIC_COMMAND(id, description) \
- CLASS(genericcommand_##id, Command) \
- ATTRIB(genericcommand_##id, m_name, string, #id); \
- ATTRIB(genericcommand_##id, m_description, string, description); \
- ENDCLASS(genericcommand_##id) \
- REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \
- METHOD(genericcommand_##id, m_invokecmd, void(genericcommand_##id this, int request, entity caller, int arguments, string command))
-
-STATIC_INIT(GENERIC_COMMANDS_aliases) {
- FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu")));
-}
-
-#include "generic.qh"
-#include "markup.qh"
-#include "rpn.qh"
-#include "all.qh"
+#include "_all.qh"
+#include "reg.qh"
#include "markup.qh"
#include "rpn.qh"
#endif
#ifdef SVQC
- #include <server/command/banning.qh>
- #include <server/command/cmd.qh>
- #include <server/command/common.qh>
- #include <server/command/sv_cmd.qh>
+ #include <server/command/_all.qh>
#include <common/turrets/config.qh>
#include <common/weapons/config.qh>
#endif
--- /dev/null
+#include "reg.qh"
--- /dev/null
+#pragma once
+
+#include "command.qh"
+REGISTRY(GENERIC_COMMANDS, BITS(7))
+#define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL)
+REGISTER_REGISTRY(GENERIC_COMMANDS)
+REGISTRY_SORT(GENERIC_COMMANDS)
+
+#define GENERIC_COMMAND(id, description) \
+ CLASS(genericcommand_##id, Command) \
+ ATTRIB(genericcommand_##id, m_name, string, #id); \
+ ATTRIB(genericcommand_##id, m_description, string, description); \
+ ENDCLASS(genericcommand_##id) \
+ REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \
+ METHOD(genericcommand_##id, m_invokecmd, void(genericcommand_##id this, int request, entity caller, int arguments, string command))
+
+STATIC_INIT(GENERIC_COMMANDS_aliases) {
+ FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu")));
+}
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#define ITEMS_ALL_C
#include "all.qh"
-#include "item/_mod.inc"
+#include "item/_all.inc"
void Dump_Items()
{
#pragma once
-#include <common/command/all.qh>
+#include <common/command/_all.qh>
#include "item.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include "all.qh"
#define IMPLEMENTATION
-#include "monster/_mod.inc"
+#include "monster/_all.inc"
#undef IMPLEMENTATION
#ifdef SVQC
REGISTER_MONSTER(Null, NEW(Monster));
-#include "monster/_mod.inc"
+#include "monster/_all.inc"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include "../turrets/util.qh"
#include "../vehicles/all.qh"
#include <server/campaign.qh>
- #include <server/command/common.qh>
- #include <server/command/cmd.qh>
+ #include <server/command/_all.qh>
#include "../triggers/triggers.qh"
#include <lib/csqcmodel/sv_model.qh>
#include <server/round_handler.qh>
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#pragma once
-#include <common/command/all.qh>
+#include <common/command/_all.qh>
#include <common/constants.qh>
#include <common/teams.qh>
#endif
#define IMPLEMENTATION
-#include "turret/_mod.inc"
+#include "turret/_all.inc"
#undef IMPLEMENTATION
#ifdef CSQC
#pragma once
-#include <common/command/all.qh>
+#include <common/command/_all.qh>
#include "config.qh"
#include "turret.qh"
REGISTER_TURRET(Null, NEW(Turret));
-#include "turret/_mod.inc"
+#include "turret/_all.inc"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
#endif
#define IMPLEMENTATION
-#include "vehicle/_mod.inc"
+#include "vehicle/_all.inc"
#undef IMPLEMENTATION
#endif
REGISTER_VEHICLE(Null, NEW(Vehicle));
-#include "vehicle/_mod.inc"
+#include "vehicle/_all.inc"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+#pragma once
--- /dev/null
+#pragma once
#include "../deathtypes/all.qh"
#include <server/mutators/all.qh>
#include "../mapinfo.qh"
- #include <server/command/common.qh>
+ #include <server/command/_all.qh>
#include <lib/csqcmodel/sv_model.qh>
#include <server/portals.qh>
#include <server/g_hook.qh>
#pragma once
-#include <common/command/all.qh>
+#include <common/command/_all.qh>
#include <common/stats.qh>
#include "config.qh"
#include "vector.qh"
#include "yenc.qh"
-#include "matrix/_mod.inc"
+#include "matrix/_all.inc"
#ifndef SVQC
#define objerror_safe(e)
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include "command.qh"
-#include <common/command/all.qh>
+#include <common/command/_mod.qh>
GENERIC_COMMAND(mx, "Send a matrix command") {
switch (argv(1)) {
#include <common/constants.qh>
#include <common/triggers/subs.qh>
#include <common/util.qh>
- #include <server/command/common.qh>
+ #include <server/command/_all.qh>
#include <server/constants.qh>
#include <server/defs.qh>
#endif
--- /dev/null
+#include <menu/_all.qh>
+#include "_mod.inc"
+
+#include "anim/_all.inc"
+#include "command/_all.inc"
+#include "item/_all.inc"
+#include "mutators/_all.inc"
+#include "xonotic/_all.inc"
+
+#include <common/_all.inc>
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
+++ /dev/null
-my %classoffile = ();
-my %classes = ();
-my %baseclass = ();
-my %methods = ();
-my %attrs = ();
-my %methodnames = ();
-my %old2new = ();
-
-print STDERR "Scanning...\n";
-for my $f(@ARGV)
-{
- open my $fh, '<', $f;
- while(<$fh>)
- {
- if(/^CLASS\(([^)]*)\)(?:\s*EXTENDS\(([^)]*)\))?/)
- {
- $classes{$1} = defined($2) ? $2 : "Object";
- $classoffile{$f} = $1;
- }
- if(/^\s*METHOD\(([^),]*),\s*([^),]*)/)
- {
- $methods{$1}{$2} = $1;
- $methodnames{"$1"."_"."$2"} = $f;
- $old2new{"$2$1"} = "$1"."_"."$2";
- }
- if(/^\s*ATTRIB(?:ARRAY)?\(([^),]*),\s*([^),]*)/)
- {
- $attrs{$1}{$2} = $1;
- }
- }
- close $fh;
-}
-
-# propagate down methods etc.
-print STDERR "Propagating...\n";
-for my $class(keys %classes)
-{
- print STDERR "$class";
- my $base = $class;
- for(;;)
- {
- $base = $classes{$base};
- last if not defined $base;
- print STDERR " -> $base";
- while(my ($method, $definingclass) = each %{$methods{$base}})
- {
- $methods{$class}{$method} = $definingclass
- if not defined $methods{$class}{$method};
- }
- while(my ($attr, $definingclass) = each %{$attrs{$base}})
- {
- $attrs{$class}{$attr} = $definingclass
- if not defined $attrs{$class}{$attr};
- }
- }
- print STDERR "\n";
-}
-
-# change all calls to base method to super, complain about skipping
-print STDERR "Fixing...\n";
-for my $f(@ARGV)
-{
- open my $fh, '<', $f;
- my $s = do { undef local $/; <$fh>; };
- my $s0 = $s;
- close $fh;
-
- my $class = $classoffile{$f};
- my $base = $classes{$class};
- next if not defined $base;
-
- for(keys %old2new)
- {
- $s =~ s/\b$_\b/$old2new{$_}/g;
- }
-
- my @methods_super = map { [ $methods{$base}{$_} . "_" . $_, "SUPER($class).$_" ]; } keys %{$methods{$base}};
- for(@methods_super)
- {
- my ($search, $replace) = @$_;
- my $n = ($s =~ s/\b$search\b/$replace/g);
- print STDERR "[$f] $search -> $replace... $n replacements\n"
- if $n;
- }
-
- for(grep { $methodnames{$_} ne $f } keys %methodnames)
- {
- if($s =~ /\b$_\b/)
- {
- print STDERR "[$f] calls non-super external method directly: $_\n";
- }
- }
-
- if($s ne $s0)
- {
- print STDERR "Rewriting $f...\n";
- open my $fh, '>', $f;
- print $fh $s;
- close $fh;
- }
-}
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include "all.qh"
-#include <common/command/all.qc>
+#include <common/command/_all.inc>
#include "../mutators/events.qh"
-#include <common/command/generic.qh>
+#include <common/command/_all.qh>
.entity firstChild, nextSibling;
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include <lib/_all.inc>
#if XONOTIC
-
-#include "../menu/_mod.inc"
-#include "anim/_mod.inc"
-#include "command/_mod.inc"
-#include "item/_mod.inc"
-#include "mutators/_mod.inc"
-#include "xonotic/_mod.inc"
-
-#include <common/_all.inc>
-
+#include "_all.inc"
#endif
#if BUILD_MOD
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include <common/constants.qh>
#include <common/mapinfo.qh>
#include <common/util.qh>
-#include <common/command/generic.qh>
+#include <common/command/_all.qh>
float GL_CheckExtension(string ext)
{
--- /dev/null
+#include <server/_all.qh>
+#include "_mod.inc"
+
+#include "bot/_all.inc"
+#include "command/_all.inc"
+#include "mutators/_all.inc"
+#include "pathlib/_all.inc"
+#include "weapons/_all.inc"
+
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
+
+#include <lib/csqcmodel/sv_model.qc>
+
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
--- /dev/null
+#include <server/bot/_all.qh>
+#include "_mod.inc"
+
+#include "default/_all.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
+
+#include "default/_all.qh"
#include "api.qh"
-
-#if 1
-
-#include "default/_mod.inc"
-#include "default/havocbot/_mod.inc"
-
-#else
-
-bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, float applygravity) { return false; }
-void bot_clientconnect(entity this) { }
-void bot_clientdisconnect(entity this) { }
-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 this, entity e) { return false; }
-void bot_think(entity this) { }
-
-entity find_bot_by_name(string name) { return NULL; }
-entity find_bot_by_number(float number) { return NULL; }
-
-void havocbot_goalrating_controlpoints(entity this, float ratingscale, vector org, float sradius) { }
-void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius) { }
-void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius) { }
-
-entity navigation_findnearestwaypoint(entity ent, float walkfromwp) { return NULL; }
-void navigation_goalrating_end(entity this) { }
-void navigation_goalrating_start(entity this) { }
-void navigation_markroutes(entity this, entity fixed_source_waypoint) { }
-void navigation_markroutes_inverted(entity fixed_source_waypoint) { }
-void navigation_routerating(entity this, 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; }
-#endif
--- /dev/null
+#include <server/bot/default/_all.qh>
+#include "_mod.inc"
+
+#include "havocbot/_all.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
+
+#include "havocbot/_all.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+#include "bot_null.qh"
+
+bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, float applygravity) { return false; }
+void bot_clientconnect(entity this) { }
+void bot_clientdisconnect(entity this) { }
+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 this, entity e) { return false; }
+void bot_think(entity this) { }
+
+entity find_bot_by_name(string name) { return NULL; }
+entity find_bot_by_number(float number) { return NULL; }
+
+void havocbot_goalrating_controlpoints(entity this, float ratingscale, vector org, float sradius) { }
+void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius) { }
+void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius) { }
+
+entity navigation_findnearestwaypoint(entity ent, float walkfromwp) { return NULL; }
+void navigation_goalrating_end(entity this) { }
+void navigation_goalrating_start(entity this) { }
+void navigation_markroutes(entity this, entity fixed_source_waypoint) { }
+void navigation_markroutes_inverted(entity fixed_source_waypoint) { }
+void navigation_routerating(entity this, 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; }
--- /dev/null
+#pragma once
+
+#include "../api.qh"
}
}
+.bool move_qcphysics;
+
void Player_Physics(entity this)
{
set_movetype(this, ((this.move_qcphysics) ? MOVETYPE_NONE : this.move_movetype));
--- /dev/null
+#include <server/command/_all.qh>
+#include "_mod.inc"
+
+#include <common/command/_all.inc>
--- /dev/null
+#pragma once
+#include "_mod.qh"
+
+#include <common/command/_all.qh>
// generated file; do not modify
-#include <server/command/all.qc>
#include <server/command/banning.qc>
#include <server/command/cmd.qc>
#ifdef SVQC
#include <server/command/common.qc>
#include <server/command/getreplies.qc>
#include <server/command/radarmap.qc>
+#include <server/command/reg.qc>
#include <server/command/vote.qc>
// generated file; do not modify
-#include <server/command/all.qh>
#include <server/command/banning.qh>
#include <server/command/cmd.qh>
#include <server/command/common.qh>
#include <server/command/getreplies.qh>
#include <server/command/radarmap.qh>
+#include <server/command/reg.qh>
#include <server/command/vote.qh>
+++ /dev/null
-#include "all.qh"
-#include <common/command/all.qc>
+++ /dev/null
-#pragma once
-
-#include <common/command/command.qh>
-REGISTRY(SERVER_COMMANDS, BITS(7))
-#define SERVER_COMMANDS_from(i) _SERVER_COMMANDS_from(i, NULL)
-REGISTER_REGISTRY(SERVER_COMMANDS)
-REGISTRY_SORT(SERVER_COMMANDS)
-
-#define SERVER_COMMAND(id, description) \
- CLASS(servercommand_##id, Command) \
- ATTRIB(servercommand_##id, m_name, string, #id); \
- ATTRIB(servercommand_##id, m_description, string, description); \
- ENDCLASS(servercommand_##id) \
- REGISTER(SERVER_COMMANDS, CMD_SV, id, m_id, NEW(servercommand_##id)); \
- METHOD(servercommand_##id, m_invokecmd, void(servercommand_##id this, int request, entity caller, int arguments, string command))
-
-STATIC_INIT(SERVER_COMMANDS_aliases) {
- FOREACH(SERVER_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_sv"))));
-}
-
-#include "sv_cmd.qh"
-
-#include "banning.qh"
-#include "cmd.qh"
-#include "common.qh"
-#include "getreplies.qh"
-#include "radarmap.qh"
-#include "vote.qh"
#include "banning.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "banning.qh"
#include "common.qh"
#include "cmd.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "common.qh"
#include "vote.qh"
#include "common.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "common.qh"
#include "../scores.qh"
#pragma once
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
REGISTRY(COMMON_COMMANDS, BITS(7))
#define COMMON_COMMANDS_from(i) _COMMON_COMMANDS_from(i, NULL)
REGISTER_REGISTRY(COMMON_COMMANDS)
#include "vote.qh"
#include <common/monsters/spawn.qh>
-#include <common/command/generic.qh>
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
// ============================================================
// Shared declarations for server commands, written by Samual
#include "getreplies.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "getreplies.qh"
#include "../race.qh"
#include "radarmap.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "radarmap.qh"
#include "../g_world.qh"
--- /dev/null
+#include "reg.qh"
--- /dev/null
+#pragma once
+
+REGISTRY(SERVER_COMMANDS, BITS(7))
+#define SERVER_COMMANDS_from(i) _SERVER_COMMANDS_from(i, NULL)
+REGISTER_REGISTRY(SERVER_COMMANDS)
+REGISTRY_SORT(SERVER_COMMANDS)
+
+#define SERVER_COMMAND(id, description) \
+ CLASS(servercommand_##id, Command) \
+ ATTRIB(servercommand_##id, m_name, string, #id); \
+ ATTRIB(servercommand_##id, m_description, string, description); \
+ ENDCLASS(servercommand_##id) \
+ REGISTER(SERVER_COMMANDS, CMD_SV, id, m_id, NEW(servercommand_##id)); \
+ METHOD(servercommand_##id, m_invokecmd, void(servercommand_##id this, int request, entity caller, int arguments, string command))
+
+STATIC_INIT(SERVER_COMMANDS_aliases) {
+ FOREACH(SERVER_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_sv"))));
+}
#include "sv_cmd.qh"
-#include "all.qh"
+#include "_all.qh"
#include "banning.qh"
#include "cmd.qh"
#include "vote.qh"
-#include <common/command/command.qh>
+#include <common/command/_all.qh>
#include "vote.qh"
#include "common.qh"
#include "weapons/accuracy.qh"
#include "weapons/csqcprojectile.qh"
#include "weapons/selection.qh"
-#include "../common/command/generic.qh"
+#include "../common/command/_all.qh"
#include "../common/constants.qh"
#include "../common/deathtypes/all.qh"
#include "../common/mapinfo.qh"
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include <common/stats.qh>
#include <common/teams.qh>
#include <common/util.qh>
- #include <common/command/markup.qh>
- #include <common/command/rpn.qh>
- #include <common/command/generic.qh>
- #include <common/command/command.qh>
+ #include <common/command/_all.qh>
#include <common/net_notice.qh>
#include <common/animdecide.qh>
#include <common/monsters/all.qh>
#include <server/bot/api.qh>
-#include <server/command/vote.qh>
+#include <server/command/_all.qh>
#include <common/monsters/all.qh>
-#include <server/command/common.qh>
-
#include <server/weapons/tracing.qh>
#include <server/weapons/weaponsystem.qh>
#include <server/bot/api.qh>
-#include <server/command/vote.qh>
-#include <server/command/common.qh>
+#include <server/command/_all.qh>
#include <server/weapons/common.qh>
#include <server/weapons/tracing.qh>
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#include <common/mutators/mutator/instagib/items.qc>
#include <server/campaign.qh>
-#include <server/command/cmd.qh>
+#include <server/command/_all.qh>
int autocvar_g_lms_extra_lives;
bool autocvar_g_lms_join_anytime;
-#ifndef DEBUGPATHING
- #define DEBUGPATHING 0
-#endif
+#include "pathlib.qh"
#include "costs.qc"
#include "expandnode.qc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
#pragma once
+#ifndef DEBUGPATHING
+ #define DEBUGPATHING 0
+#endif
+
.entity pathlib_list;
.entity path_next;
.entity path_prev;
-#ifndef DEBUGPATHING
- #define DEBUGPATHING 0
-#endif
-
#include <lib/_all.inc>
#if XONOTIC
-
-#include "_all.qh"
-
-#include "../server/_mod.inc"
-#include "bot/_mod.inc"
-#include "command/_mod.inc"
-#include "mutators/_mod.inc"
-#include "pathlib/_all.inc"
-#include "weapons/_mod.inc"
-
-#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
-
-#include <lib/csqcmodel/sv_model.qc>
-
-#include <lib/warpzone/anglestransform.qc>
-#include <lib/warpzone/common.qc>
-#include <lib/warpzone/server.qc>
-#include <lib/warpzone/util_server.qc>
-
+#include "_all.inc"
#endif
#include <ecs/_lib.inc>
#include "autocvars.qh"
#include "cl_client.qh"
-#include "command/all.qh"
+#include "command/_all.qh"
#include "weapons/common.qh"
#include "weapons/selection.qh"
#include <common/items/item.qh>
--- /dev/null
+#include "_all.qh"
+#include "_mod.inc"
--- /dev/null
+#pragma once
+#include "_mod.qh"
--- /dev/null
+my %classoffile = ();
+my %classes = ();
+my %baseclass = ();
+my %methods = ();
+my %attrs = ();
+my %methodnames = ();
+my %old2new = ();
+
+print STDERR "Scanning...\n";
+for my $f(@ARGV)
+{
+ open my $fh, '<', $f;
+ while(<$fh>)
+ {
+ if(/^CLASS\(([^)]*)\)(?:\s*EXTENDS\(([^)]*)\))?/)
+ {
+ $classes{$1} = defined($2) ? $2 : "Object";
+ $classoffile{$f} = $1;
+ }
+ if(/^\s*METHOD\(([^),]*),\s*([^),]*)/)
+ {
+ $methods{$1}{$2} = $1;
+ $methodnames{"$1"."_"."$2"} = $f;
+ $old2new{"$2$1"} = "$1"."_"."$2";
+ }
+ if(/^\s*ATTRIB(?:ARRAY)?\(([^),]*),\s*([^),]*)/)
+ {
+ $attrs{$1}{$2} = $1;
+ }
+ }
+ close $fh;
+}
+
+# propagate down methods etc.
+print STDERR "Propagating...\n";
+for my $class(keys %classes)
+{
+ print STDERR "$class";
+ my $base = $class;
+ for(;;)
+ {
+ $base = $classes{$base};
+ last if not defined $base;
+ print STDERR " -> $base";
+ while(my ($method, $definingclass) = each %{$methods{$base}})
+ {
+ $methods{$class}{$method} = $definingclass
+ if not defined $methods{$class}{$method};
+ }
+ while(my ($attr, $definingclass) = each %{$attrs{$base}})
+ {
+ $attrs{$class}{$attr} = $definingclass
+ if not defined $attrs{$class}{$attr};
+ }
+ }
+ print STDERR "\n";
+}
+
+# change all calls to base method to super, complain about skipping
+print STDERR "Fixing...\n";
+for my $f(@ARGV)
+{
+ open my $fh, '<', $f;
+ my $s = do { undef local $/; <$fh>; };
+ my $s0 = $s;
+ close $fh;
+
+ my $class = $classoffile{$f};
+ my $base = $classes{$class};
+ next if not defined $base;
+
+ for(keys %old2new)
+ {
+ $s =~ s/\b$_\b/$old2new{$_}/g;
+ }
+
+ my @methods_super = map { [ $methods{$base}{$_} . "_" . $_, "SUPER($class).$_" ]; } keys %{$methods{$base}};
+ for(@methods_super)
+ {
+ my ($search, $replace) = @$_;
+ my $n = ($s =~ s/\b$search\b/$replace/g);
+ print STDERR "[$f] $search -> $replace... $n replacements\n"
+ if $n;
+ }
+
+ for(grep { $methodnames{$_} ne $f } keys %methodnames)
+ {
+ if($s =~ /\b$_\b/)
+ {
+ print STDERR "[$f] calls non-super external method directly: $_\n";
+ }
+ }
+
+ if($s ne $s0)
+ {
+ print STDERR "Rewriting $f...\n";
+ open my $fh, '>', $f;
+ print $fh $s;
+ close $fh;
+ }
+}
-DNDEBUG=1
-DXONOTIC=1
-DWATERMARK="\"$(git describe --tags --dirty='~')\""
- -DDEBUGPATHING=0
)
QCCDEFS="${QCCDEFS[@]}"
echo "$file"
startswith "$file" "#pragma once"
done
+ find "$base" -type f -name '_mod.inc' -print0 | sort -z | while read -r -d '' file; do
+ echo "$file"
+ declare -l file_inc="${file%_mod.inc}_all.inc"
+ if [ ! -f "$file_inc" ]; then
+ echo '#include "_all.qh"' > "$file_inc"
+ echo '#include "_mod.inc"' >> "$file_inc"
+ fi
+ declare -l file_qh="${file%_mod.inc}_all.qh"
+ if [ ! -f "$file_qh" ]; then
+ echo '#pragma once' > "$file_qh"
+ echo '#include "_mod.qh"' >> "$file_qh"
+ fi
+ done
}
check client
check server
check menu
+
+# TODO: check that "_mod.(qc|inc)" is not included except by "_all.(qc|inc)"