From: Mario Date: Thu, 13 Jul 2017 02:44:43 +0000 (+1000) Subject: Move some variables out of constants.qh X-Git-Tag: xonotic-v0.8.5~2642 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0c92481c72ae52b468998c31fb78f809a99bb53;p=xonotic%2Fxonotic-data.pk3dir.git Move some variables out of constants.qh --- diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 6fd6fe9c7..18ea6d7d1 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -2,10 +2,6 @@ const int RANKINGS_CNT = 15; -const int SPRITERULE_DEFAULT = 0; -const int SPRITERULE_TEAMPLAY = 1; -const int SPRITERULE_SPECTATOR = 2; - /////////////////////////// // keys pressed const int KEY_FORWARD = BIT(0); @@ -34,8 +30,6 @@ const int HUD_BUMBLEBEE_GUN = 25; // # of maps, I'll use arrays for them :P const int MAPVOTE_COUNT = 30; -// game mode specific indices are not in common/, but in server/scores_rules.qc! - const int SPECIES_HUMAN = 0; const int SPECIES_ROBOT_SOLID = 1; const int SPECIES_ALIEN = 2; @@ -50,44 +44,15 @@ const int FRAGS_LMS_LOSER = -616; const int FRAGS_PLAYER_NONSOLID = FRAGS_LMS_LOSER; // we can use this frags value for both -// water levels -const int WATERLEVEL_NONE = 0; -const int WATERLEVEL_WETFEET = 1; -const int WATERLEVEL_SWIMMING = 2; -const int WATERLEVEL_SUBMERGED = 3; - // server flags const int SERVERFLAG_ALLOW_FULLBRIGHT = 1; const int SERVERFLAG_TEAMPLAY = 2; const int SERVERFLAG_PLAYERSTATS = 4; -#ifdef SVQC -// FIXME/EXPLAINME: why? Mario: because -vector autocvar_sv_player_maxs = '16 16 45'; -vector autocvar_sv_player_mins = '-16 -16 -24'; -vector autocvar_sv_player_viewoffset = '0 0 35'; -vector autocvar_sv_player_crouch_maxs = '16 16 25'; -vector autocvar_sv_player_crouch_mins = '-16 -16 -24'; -vector autocvar_sv_player_crouch_viewoffset = '0 0 20'; -//vector autocvar_sv_player_headsize = '24 24 12'; - -// temporary array used to dump weapon and turret settings -const int MAX_CONFIG_SETTINGS = 256; -string config_queue[MAX_CONFIG_SETTINGS]; - -#endif - - // a bit more constant const vector PL_MAX_CONST = '16 16 45'; const vector PL_MIN_CONST = '-16 -16 -24'; -// spawnpoint prios -const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200; -const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100; -const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50; -const int SPAWN_PRIO_GOOD_DISTANCE = 10; - // gametype vote flags const int GTV_FORBIDDEN = 0; // Cannot be voted const int GTV_AVAILABLE = 1; // Can be voted diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index 62a7cac61..d77a4aa61 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -5,6 +5,10 @@ /** Additional networked waypoint state, used for items, weapons, buffs */ .int wp_extra; +const int SPRITERULE_DEFAULT = 0; +const int SPRITERULE_TEAMPLAY = 1; +const int SPRITERULE_SPECTATOR = 2; + #ifdef CSQC entityclass(WaypointSprite); class(WaypointSprite) .float helpme; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 4cd184e9e..dbd765d98 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -1,5 +1,11 @@ #pragma once +// water levels +const int WATERLEVEL_NONE = 0; +const int WATERLEVEL_WETFEET = 1; +const int WATERLEVEL_SWIMMING = 2; +const int WATERLEVEL_SUBMERGED = 3; + #define IS_ONGROUND(s) boolean((s).flags & FL_ONGROUND) #define SET_ONGROUND(s) ((s).flags |= FL_ONGROUND) #define UNSET_ONGROUND(s) ((s).flags &= ~FL_ONGROUND) diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 07c3d1cb9..88c735c63 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -292,6 +292,17 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE) #endif +#ifdef SVQC +// FIXME/EXPLAINME: why? Mario: because +vector autocvar_sv_player_maxs = '16 16 45'; +vector autocvar_sv_player_mins = '-16 -16 -24'; +vector autocvar_sv_player_viewoffset = '0 0 35'; +vector autocvar_sv_player_crouch_maxs = '16 16 25'; +vector autocvar_sv_player_crouch_mins = '-16 -16 -24'; +vector autocvar_sv_player_crouch_viewoffset = '0 0 20'; +//vector autocvar_sv_player_headsize = '24 24 12'; +#endif + REGISTER_NET_C2S(setpause) #ifdef CSQC void unpause_update() diff --git a/qcsrc/common/scores.qh b/qcsrc/common/scores.qh index 0451fd9c2..646638a80 100644 --- a/qcsrc/common/scores.qh +++ b/qcsrc/common/scores.qh @@ -14,6 +14,7 @@ STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); } * Score indices */ +// game mode specific indices are not in common/, but in server/scores_rules.qc! #ifdef GAMEQC REGISTER_SP(END); diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index d74275a9c..6e9b31a74 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -4,6 +4,12 @@ vector real_origin(entity ent); #endif +#ifdef SVQC +// temporary array used to dump weapon and turret settings +const int MAX_CONFIG_SETTINGS = 256; +string config_queue[MAX_CONFIG_SETTINGS]; +#endif + .string netname; .string message; diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index d8c76dbf3..94deed551 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -26,7 +26,7 @@ #include "../constants.qh" #include "../stats.qh" #include "../teams.qh" - #include "../util.qh" + #include #include "../monsters/_mod.qh" #include "config.qh" #include diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index 7f87388db..a8194772c 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -2,7 +2,7 @@ #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include "../util.qh" + #include #include "all.qh" #endif diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh index 05e1d3d38..84094df6b 100644 --- a/qcsrc/server/mutators/gamemode.qh +++ b/qcsrc/server/mutators/gamemode.qh @@ -72,6 +72,8 @@ #include #include +#include + #include #include #include diff --git a/qcsrc/server/spawnpoints.qh b/qcsrc/server/spawnpoints.qh index 56e00b5ac..92af8df66 100644 --- a/qcsrc/server/spawnpoints.qh +++ b/qcsrc/server/spawnpoints.qh @@ -1,5 +1,11 @@ #pragma once +// spawnpoint prios +const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200; +const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100; +const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50; +const int SPAWN_PRIO_GOOD_DISTANCE = 10; + .vector spawnpoint_score; float spawnpoint_nag; bool SpawnEvent_Send(entity this, entity to, int sf);