From: Mario Date: Sat, 1 Aug 2020 23:00:41 +0000 (+1000) Subject: Move some weapon definitions out of defs.qh, fix compilation units test X-Git-Tag: xonotic-v0.8.5~808 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=08ce36be60879ddd1988bdd6ee77ce8cb446a850;p=xonotic%2Fxonotic-data.pk3dir.git Move some weapon definitions out of defs.qh, fix compilation units test --- diff --git a/qcsrc/client/items/items.qc b/qcsrc/client/items/items.qc index 72f69ee07..06135a9f2 100644 --- a/qcsrc/client/items/items.qc +++ b/qcsrc/client/items/items.qc @@ -13,6 +13,7 @@ bool autocvar_cl_ghost_items_vehicle = true; .vector item_glowmod; .bool item_simple; // probably not really needed, but better safe than sorry .float alpha; +.bool pushable; void Item_SetAlpha(entity this) { bool veh_hud = (hud && autocvar_cl_ghost_items_vehicle); diff --git a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc index 47e1c97a9..c3e008378 100644 --- a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc @@ -1,6 +1,7 @@ #include "sv_new_toys.qh" #include "../random_items/sv_random_items.qh" +#include /* diff --git a/qcsrc/common/mutators/mutator/nix/sv_nix.qc b/qcsrc/common/mutators/mutator/nix/sv_nix.qc index b399d3c62..867da41d4 100644 --- a/qcsrc/common/mutators/mutator/nix/sv_nix.qc +++ b/qcsrc/common/mutators/mutator/nix/sv_nix.qc @@ -1,5 +1,7 @@ #include "sv_nix.qh" +#include + //string autocvar_g_nix; int autocvar_g_balance_nix_ammo_cells; int autocvar_g_balance_nix_ammo_plasma; diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 0ff479777..296114539 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -4,6 +4,8 @@ #include #include +#include +#include #include "../cvars.qh" #include "../aim.qh" diff --git a/qcsrc/server/bot/default/scripting.qc b/qcsrc/server/bot/default/scripting.qc index 20b29a86c..210e97104 100644 --- a/qcsrc/server/bot/default/scripting.qc +++ b/qcsrc/server/bot/default/scripting.qc @@ -2,6 +2,7 @@ #include #include +#include #include "cvars.qh" #include diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 1e50f3edb..bbf9ec9fa 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -116,18 +116,6 @@ const float MAX_DAMAGEEXTRARADIUS = 16; // WEAPONTODO .float autoswitch; -bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain); -void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire); -void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire); -// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies) -.float weapon_nextthink; -.void(Weapon thiswep, entity actor, .entity weaponentity, int fire) weapon_think; - - -// there is 2 weapon tics that can run in one server frame -const int W_TICSPERFRAME = 2; - -void weapon_defaultspawnfunc(entity this, Weapon e); float intermission_running; float intermission_exittime; @@ -186,8 +174,6 @@ float default_weapon_alpha; string gamemode_name; -string W_Apply_Weaponreplace(string in); - void FixIntermissionClient(entity e); void FixClientCvars(entity e); @@ -296,12 +282,6 @@ string matchid; bool radar_showennemies; -.float weapon_load[REGISTRY_MAX(Weapons)]; -.int ammo_none; // used by the reloading system, must always be 0 -.int clip_load; -.int old_clip_load; -.int clip_size; - .int minelayer_mines; .float vortex_charge; .float vortex_charge_rottime; diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 66b5bc9d4..ef72b964f 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -6,6 +6,8 @@ #include +#include + #include #include #include @@ -14,10 +16,12 @@ #include #include #include +#include #include #include +#include #include #include diff --git a/qcsrc/server/items/items.qh b/qcsrc/server/items/items.qh index 825bd2f01..d135ee387 100644 --- a/qcsrc/server/items/items.qh +++ b/qcsrc/server/items/items.qh @@ -1,5 +1,7 @@ #pragma once +#include + void StartItem(entity this, entity a); .int item_group; .int item_group_count; diff --git a/qcsrc/server/items/spawning.qc b/qcsrc/server/items/spawning.qc index bbe662227..f1c8796c7 100644 --- a/qcsrc/server/items/spawning.qc +++ b/qcsrc/server/items/spawning.qc @@ -6,6 +6,7 @@ /// \copyright GNU GPLv2 or any later version. #include +#include #include #include diff --git a/qcsrc/server/weapons/weaponsystem.qh b/qcsrc/server/weapons/weaponsystem.qh index 986756aa5..dd9e42a24 100644 --- a/qcsrc/server/weapons/weaponsystem.qh +++ b/qcsrc/server/weapons/weaponsystem.qh @@ -1,15 +1,31 @@ #pragma once -#include #include +// there is 2 weapon tics that can run in one server frame +const int W_TICSPERFRAME = 2; + +// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies) +.float weapon_nextthink; +.void(Weapon thiswep, entity actor, .entity weaponentity, int fire) weapon_think; + float internalteam; entity weapon_dropevent_item; ..entity weaponentity_fld; +.float weapon_load[REGISTRY_MAX(Weapons)]; +.int ammo_none; // used by the reloading system, must always be 0 +.int clip_load; +.int old_clip_load; +.int clip_size; + void CL_SpawnWeaponentity(entity e, .entity weaponentity); +void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire); + +void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire); + vector CL_Weapon_GetShotOrg(float wpn); bool weaponUseForbidden(entity player);