From f9e4718d229df569d7878259d3db2bd2df1e7b91 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 11 Oct 2015 18:10:16 +1100 Subject: [PATCH] common: move instagib and nexball as they add custom items and weapons --- qcsrc/client/progs.inc | 1 + qcsrc/client/view.qc | 1 + qcsrc/common/gamemodes/all.inc | 1 + qcsrc/common/gamemodes/all.qc | 5 ++ qcsrc/common/gamemodes/all.qh | 6 ++ .../gamemodes/gamemode/nexball/nexball.qc} | 15 ++-- .../gamemodes/gamemode/nexball/nexball.qh} | 6 ++ .../gamemodes/gamemode/nexball/weapon.qc} | 0 qcsrc/common/items/all.inc | 1 - qcsrc/common/items/all.qh | 3 + qcsrc/common/mutators/all.inc | 1 + qcsrc/common/mutators/all.qc | 4 + qcsrc/common/mutators/all.qh | 6 ++ qcsrc/common/mutators/base.qh | 2 +- qcsrc/common/mutators/mutator/casings.qc | 3 + qcsrc/common/mutators/mutator/damagetext.qc | 12 ++- .../mutators/mutator/instagib/instagib.qc} | 90 ++++++++----------- .../mutators/mutator/instagib/items.qc} | 6 +- qcsrc/common/mutators/mutator/itemstime.qc | 2 + .../mutator/waypoints/waypointsprites.qc | 3 + qcsrc/common/physics.qc | 12 +-- qcsrc/common/weapons/all.inc | 2 - qcsrc/common/weapons/all.qh | 11 ++- qcsrc/server/mutators/mutator_buffs.qc | 1 + qcsrc/server/mutators/mutator_nades.qc | 1 + qcsrc/server/mutators/mutators.qc | 1 - qcsrc/server/mutators/mutators.qh | 2 - qcsrc/server/mutators/mutators_include.qc | 2 - qcsrc/server/mutators/mutators_include.qh | 1 - qcsrc/server/progs.inc | 1 + qcsrc/server/teamplay.qc | 1 + 31 files changed, 114 insertions(+), 89 deletions(-) create mode 100644 qcsrc/common/gamemodes/all.inc create mode 100644 qcsrc/common/gamemodes/all.qc create mode 100644 qcsrc/common/gamemodes/all.qh rename qcsrc/{server/mutators/gamemode_nexball.qc => common/gamemodes/gamemode/nexball/nexball.qc} (99%) rename qcsrc/{server/mutators/gamemode_nexball.qh => common/gamemodes/gamemode/nexball/nexball.qh} (92%) rename qcsrc/{server/mutators/gamemode_nexball_weapon.qc => common/gamemodes/gamemode/nexball/weapon.qc} (100%) create mode 100644 qcsrc/common/mutators/all.qh rename qcsrc/{server/mutators/mutator_instagib.qc => common/mutators/mutator/instagib/instagib.qc} (79%) rename qcsrc/{server/mutators/mutator_instagib_items.qc => common/mutators/mutator/instagib/items.qc} (94%) diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index 04eb78822..61bd8b934 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -49,6 +49,7 @@ #include "../common/buffs/all.qc" #include "../common/effects/all.qc" +#include "../common/gamemodes/all.qc" #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index fad769d01..4430c94e2 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -12,6 +12,7 @@ #include "../common/constants.qh" #include "../common/mapinfo.qh" +#include "../common/gamemodes/all.qh" #include "../common/nades/all.qh" #include "../common/stats.qh" #include "../common/triggers/target/music.qh" diff --git a/qcsrc/common/gamemodes/all.inc b/qcsrc/common/gamemodes/all.inc new file mode 100644 index 000000000..4c24bebf5 --- /dev/null +++ b/qcsrc/common/gamemodes/all.inc @@ -0,0 +1 @@ +#include "gamemode/nexball/nexball.qc" diff --git a/qcsrc/common/gamemodes/all.qc b/qcsrc/common/gamemodes/all.qc new file mode 100644 index 000000000..f0fc7195a --- /dev/null +++ b/qcsrc/common/gamemodes/all.qc @@ -0,0 +1,5 @@ +#include "all.qh" + +#define IMPLEMENTATION +#include "all.inc" +#undef IMPLEMENTATION diff --git a/qcsrc/common/gamemodes/all.qh b/qcsrc/common/gamemodes/all.qh new file mode 100644 index 000000000..62ba61696 --- /dev/null +++ b/qcsrc/common/gamemodes/all.qh @@ -0,0 +1,6 @@ +#ifndef GAMEMODES_ALL_H +#define GAMEMODES_ALL_H + +#include "all.inc" + +#endif diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc similarity index 99% rename from qcsrc/server/mutators/gamemode_nexball.qc rename to qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 6d5cd7600..7958d66f6 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -1,7 +1,7 @@ -#include "gamemode_nexball.qh" - -#include "gamemode.qh" +#include "nexball.qh" +#ifdef IMPLEMENTATION +#ifdef SVQC float autocvar_g_nexball_basketball_bouncefactor; float autocvar_g_nexball_basketball_bouncestop; float autocvar_g_nexball_basketball_carrier_highspeed; @@ -27,9 +27,9 @@ vector autocvar_g_nexball_viewmodel_offset; void basketball_touch(); void football_touch(); void ResetBall(); -const float NBM_NONE = 0; -const float NBM_FOOTBALL = 2; -const float NBM_BASKETBALL = 4; +const int NBM_NONE = 0; +const int NBM_FOOTBALL = 2; +const int NBM_BASKETBALL = 4; float nexball_mode; float OtherTeam(float t) //works only if there are two teams on the map! @@ -1046,3 +1046,6 @@ MUTATOR_DEFINITION(gamemode_nexball) return 0; } + +#endif +#endif diff --git a/qcsrc/server/mutators/gamemode_nexball.qh b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh similarity index 92% rename from qcsrc/server/mutators/gamemode_nexball.qh rename to qcsrc/common/gamemodes/gamemode/nexball/nexball.qh index e28fad883..7d19c50e7 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qh +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qh @@ -1,6 +1,11 @@ #ifndef GAMEMODE_NEXBALL_H #define GAMEMODE_NEXBALL_H +#include "weapon.qc" + +#ifdef SVQC +MUTATOR_DECLARATION(gamemode_nexball); + //EF_BRIGHTFIELD|EF_BRIGHTLIGHT|EF_DIMLIGHT|EF_BLUE|EF_RED|EF_FLAME const float BALL_EFFECTMASK = 1229; const vector BALL_MINS = '-16 -16 -16'; // The model is 24*24*24 @@ -34,3 +39,4 @@ float nb_teams; .float teamtime; #endif +#endif diff --git a/qcsrc/server/mutators/gamemode_nexball_weapon.qc b/qcsrc/common/gamemodes/gamemode/nexball/weapon.qc similarity index 100% rename from qcsrc/server/mutators/gamemode_nexball_weapon.qc rename to qcsrc/common/gamemodes/gamemode/nexball/weapon.qc diff --git a/qcsrc/common/items/all.inc b/qcsrc/common/items/all.inc index d322db4b7..48b92bee6 100644 --- a/qcsrc/common/items/all.inc +++ b/qcsrc/common/items/all.inc @@ -5,4 +5,3 @@ #include "item/jetpack.qc" #include "item/pickup.qc" #include "item/powerup.qc" -#include "../../server/mutators/mutator_instagib_items.qc" diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index 92c77579a..a825b4ed1 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -10,6 +10,9 @@ REGISTER_REGISTRY(RegisterItems) /** If you register a new item, make sure to add it to all.inc */ #define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, Items, id, m_id, NEW(class)) +REGISTRY_SORT(Items, m_name, 0) +STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); } + void Dump_Items(); GENERIC_COMMAND(dumpitems, "Dump all items to the console") { diff --git a/qcsrc/common/mutators/all.inc b/qcsrc/common/mutators/all.inc index 1d02fc371..6b19a0bc6 100644 --- a/qcsrc/common/mutators/all.inc +++ b/qcsrc/common/mutators/all.inc @@ -1,4 +1,5 @@ #include "mutator/casings.qc" #include "mutator/damagetext.qc" +#include "mutator/instagib/instagib.qc" #include "mutator/itemstime.qc" #include "mutator/waypoints/waypointsprites.qc" diff --git a/qcsrc/common/mutators/all.qc b/qcsrc/common/mutators/all.qc index 14530a3c5..f0fc7195a 100644 --- a/qcsrc/common/mutators/all.qc +++ b/qcsrc/common/mutators/all.qc @@ -1 +1,5 @@ +#include "all.qh" + +#define IMPLEMENTATION #include "all.inc" +#undef IMPLEMENTATION diff --git a/qcsrc/common/mutators/all.qh b/qcsrc/common/mutators/all.qh new file mode 100644 index 000000000..ceb4b51dd --- /dev/null +++ b/qcsrc/common/mutators/all.qh @@ -0,0 +1,6 @@ +#ifndef MUTATORS_ALL_H +#define MUTATORS_ALL_H + +#include "all.inc" + +#endif diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index 6e1c7c051..f6fa534d6 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -265,7 +265,7 @@ STATIC_INIT_LATE(Mutators) { #define MUTATOR_HOOK(cb, func, order) do { \ MUTATOR_ONADD { \ if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) { \ - LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n"); \ + LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n"); \ return true; \ } \ } \ diff --git a/qcsrc/common/mutators/mutator/casings.qc b/qcsrc/common/mutators/mutator/casings.qc index 9ed5fefa7..fe945c9ea 100644 --- a/qcsrc/common/mutators/mutator/casings.qc +++ b/qcsrc/common/mutators/mutator/casings.qc @@ -1,3 +1,5 @@ +#ifdef IMPLEMENTATION + #include "../../util.qh" #ifdef CSQC @@ -175,3 +177,4 @@ MUTATOR_HOOKFUNCTION(casings, CSQC_Parse_TempEntity) } #endif +#endif diff --git a/qcsrc/common/mutators/mutator/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext.qc index e4e4be5e8..d1f513a4b 100644 --- a/qcsrc/common/mutators/mutator/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext.qc @@ -1,3 +1,13 @@ +#ifndef MUTATOR_DAMAGETEXT_H +#define MUTATOR_DAMAGETEXT_H + +#ifdef MENUQC +#include "../../../menu/xonotic/tab.qc" +#endif + +#endif + +#ifdef IMPLEMENTATION REGISTER_MUTATOR(damagetext, true); #if defined(CSQC) || defined(MENUQC) @@ -111,7 +121,6 @@ MUTATOR_HOOKFUNCTION(damagetext, CSQC_Parse_TempEntity) { #endif #ifdef MENUQC -#include "../../../menu/xonotic/tab.qc" CLASS(XonoticDamageTextSettings, XonoticTab) #include "../../../menu/gamesettings.qh" REGISTER_SETTINGS(damagetext, NEW(XonoticDamageTextSettings)); @@ -140,3 +149,4 @@ CLASS(XonoticDamageTextSettings, XonoticTab) } ENDCLASS(XonoticDamageTextSettings) #endif +#endif diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/common/mutators/mutator/instagib/instagib.qc similarity index 79% rename from qcsrc/server/mutators/mutator_instagib.qc rename to qcsrc/common/mutators/mutator/instagib/instagib.qc index dc1d0eba5..cc6f405e6 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/instagib.qc @@ -1,10 +1,19 @@ +#ifndef MUTATOR_INSTAGIB_H +#define MUTATOR_INSTAGIB_H -#include "mutator.qh" +#include "items.qc" -#include "../cl_client.qh" -#include "../../common/buffs/all.qh" +#endif -#include "../../common/items/all.qc" +#ifdef IMPLEMENTATION +#ifdef SVQC + +#include "../../../../server/cl_client.qh" +#include "../../../buffs/all.qh" + +#include "../../../items/all.qc" + +REGISTER_MUTATOR(mutator_instagib, cvar("g_instagib") && !g_nexball); spawnfunc(item_minst_cells) { @@ -122,7 +131,7 @@ void instagib_ammocheck() self.instagib_nextthink = time + 1; } -MUTATOR_HOOKFUNCTION(instagib_MatchEnd) +MUTATOR_HOOKFUNCTION(mutator_instagib, MatchEnd) { entity head; FOR_EACH_PLAYER(head) @@ -131,14 +140,14 @@ MUTATOR_HOOKFUNCTION(instagib_MatchEnd) return false; } -MUTATOR_HOOKFUNCTION(instagib_MonsterLoot) +MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem) { other.monster_loot = spawnfunc_item_minst_cells; return false; } -MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn) +MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn) {SELFPARAM(); // always refill ammo if(self.monsterid == MON_MAGE.monsterid) @@ -147,7 +156,7 @@ MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn) return false; } -MUTATOR_HOOKFUNCTION(instagib_BotShouldAttack) +MUTATOR_HOOKFUNCTION(mutator_instagib, BotShouldAttack) { if (checkentity.items & ITEM_Invisibility.m_itemid) return true; @@ -155,31 +164,31 @@ MUTATOR_HOOKFUNCTION(instagib_BotShouldAttack) return false; } -MUTATOR_HOOKFUNCTION(instagib_MakePlayerObserver) +MUTATOR_HOOKFUNCTION(mutator_instagib, MakePlayerObserver) {SELFPARAM(); instagib_stop_countdown(self); return false; } -MUTATOR_HOOKFUNCTION(instagib_PlayerSpawn) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerSpawn) {SELFPARAM(); self.effects |= EF_FULLBRIGHT; return false; } -MUTATOR_HOOKFUNCTION(instagib_PlayerPreThink) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPreThink) { instagib_ammocheck(); return false; } -MUTATOR_HOOKFUNCTION(instagib_PlayerRegen) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerRegen) { // no regeneration in instagib return true; } -MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) {SELFPARAM(); if (!(self.effects & EF_FULLBRIGHT)) self.effects |= EF_FULLBRIGHT; @@ -230,7 +239,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups) .float stat_sv_maxspeed; -MUTATOR_HOOKFUNCTION(instagib_PlayerPhysics) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPhysics) {SELFPARAM(); if(self.items & ITEM_Speed.m_itemid) self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_instagib_speed_highspeed; @@ -238,7 +247,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPhysics) return false; } -MUTATOR_HOOKFUNCTION(instagib_SplitHealthArmor) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_SplitHealthArmor) { damage_save = 0; damage_take = frag_damage; @@ -246,14 +255,14 @@ MUTATOR_HOOKFUNCTION(instagib_SplitHealthArmor) return false; } -MUTATOR_HOOKFUNCTION(instagib_ForbidThrowing) +MUTATOR_HOOKFUNCTION(mutator_instagib, ForbidThrowCurrentWeapon) { // weapon dropping on death handled by FilterItem return true; } -MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate) { if(autocvar_g_friendlyfire == 0 && SAME_TEAM(frag_target, frag_attacker) && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker)) frag_damage = 0; @@ -322,7 +331,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) return false; } -MUTATOR_HOOKFUNCTION(instagib_SetStartItems) +MUTATOR_HOOKFUNCTION(mutator_instagib, SetStartItems) { start_health = warmup_start_health = 100; start_armorvalue = warmup_start_armorvalue = 0; @@ -340,7 +349,7 @@ MUTATOR_HOOKFUNCTION(instagib_SetStartItems) return false; } -MUTATOR_HOOKFUNCTION(instagib_FilterItem) +MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem) {SELFPARAM(); if(self.classname == "item_cells") return true; // no normal cells? @@ -374,7 +383,7 @@ MUTATOR_HOOKFUNCTION(instagib_FilterItem) return true; } -MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint) +MUTATOR_HOOKFUNCTION(mutator_instagib, CustomizeWaypoint) {SELFPARAM(); entity e = WaypointSprite_getviewentity(other); @@ -387,7 +396,7 @@ MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint) return false; } -MUTATOR_HOOKFUNCTION(instagib_PlayerDies) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies) { if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id)) frag_damage = 1000; // always gib if it was a vaporizer death @@ -395,7 +404,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDies) return FALSE; } -MUTATOR_HOOKFUNCTION(instagib_ItemTouch) +MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch) {SELFPARAM(); if(self.ammo_cells) { @@ -424,7 +433,7 @@ MUTATOR_HOOKFUNCTION(instagib_ItemTouch) return MUT_ITEMTOUCH_CONTINUE; } -MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn) +MUTATOR_HOOKFUNCTION(mutator_instagib, OnEntityPreSpawn) {SELFPARAM(); if (!autocvar_g_powerups) { return false; } // Can't use .itemdef here @@ -449,48 +458,23 @@ MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn) return true; } -MUTATOR_HOOKFUNCTION(instagib_BuildMutatorsString) +MUTATOR_HOOKFUNCTION(mutator_instagib, BuildMutatorsString) { ret_string = strcat(ret_string, ":instagib"); return false; } -MUTATOR_HOOKFUNCTION(instagib_BuildMutatorsPrettyString) +MUTATOR_HOOKFUNCTION(mutator_instagib, BuildMutatorsPrettyString) { ret_string = strcat(ret_string, ", instagib"); return false; } -MUTATOR_HOOKFUNCTION(instagib_SetModname) +MUTATOR_HOOKFUNCTION(mutator_instagib, SetModname) { modname = "instagib"; return true; } -MUTATOR_DEFINITION(mutator_instagib) -{ - MUTATOR_HOOK(MatchEnd, instagib_MatchEnd, CBC_ORDER_ANY); - MUTATOR_HOOK(MonsterDropItem, instagib_MonsterLoot, CBC_ORDER_ANY); - MUTATOR_HOOK(MonsterSpawn, instagib_MonsterSpawn, CBC_ORDER_ANY); - MUTATOR_HOOK(BotShouldAttack, instagib_BotShouldAttack, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerPhysics, instagib_PlayerPhysics, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerSpawn, instagib_PlayerSpawn, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerDamage_Calculate, instagib_PlayerDamage, CBC_ORDER_ANY); - MUTATOR_HOOK(MakePlayerObserver, instagib_MakePlayerObserver, CBC_ORDER_ANY); - MUTATOR_HOOK(SetStartItems, instagib_SetStartItems, CBC_ORDER_ANY); - MUTATOR_HOOK(ItemTouch, instagib_ItemTouch, CBC_ORDER_ANY); - MUTATOR_HOOK(FilterItem, instagib_FilterItem, CBC_ORDER_ANY); - MUTATOR_HOOK(CustomizeWaypoint, instagib_CustomizeWaypoint, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerDies, instagib_PlayerDies, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, instagib_SplitHealthArmor, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerPowerups, instagib_PlayerPowerups, CBC_ORDER_ANY); - MUTATOR_HOOK(ForbidThrowCurrentWeapon, instagib_ForbidThrowing, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerPreThink, instagib_PlayerPreThink, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerRegen, instagib_PlayerRegen, CBC_ORDER_ANY); - MUTATOR_HOOK(OnEntityPreSpawn, instagib_OnEntityPreSpawn, CBC_ORDER_ANY); - MUTATOR_HOOK(BuildMutatorsString, instagib_BuildMutatorsString, CBC_ORDER_ANY); - MUTATOR_HOOK(BuildMutatorsPrettyString, instagib_BuildMutatorsPrettyString, CBC_ORDER_ANY); - MUTATOR_HOOK(SetModname, instagib_SetModname, CBC_ORDER_ANY); - - return false; -} +#endif +#endif diff --git a/qcsrc/server/mutators/mutator_instagib_items.qc b/qcsrc/common/mutators/mutator/instagib/items.qc similarity index 94% rename from qcsrc/server/mutators/mutator_instagib_items.qc rename to qcsrc/common/mutators/mutator/instagib/items.qc index deecb1467..2d804f758 100644 --- a/qcsrc/server/mutators/mutator_instagib_items.qc +++ b/qcsrc/common/mutators/mutator/instagib/items.qc @@ -1,6 +1,6 @@ -#include "../../common/items/all.qh" -#include "../../common/items/item/ammo.qh" -#include "../../common/items/item/powerup.qh" +#include "../../../items/all.qh" +#include "../../../items/item/ammo.qh" +#include "../../../items/item/powerup.qh" float instagib_respawntime_ammo = 45; float instagib_respawntimejitter_ammo = 0; diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index 1d615b7c0..170862ad3 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -1,3 +1,4 @@ +#ifdef IMPLEMENTATION REGISTER_MUTATOR(itemstime, true); #ifdef SVQC @@ -388,3 +389,4 @@ void HUD_ItemsTime() } #endif +#endif diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 3be3266bc..89d1b2374 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -1,5 +1,7 @@ #include "waypointsprites.qh" +#ifdef IMPLEMENTATION + REGISTER_MUTATOR(waypointsprites, true); #ifdef SVQC @@ -1148,3 +1150,4 @@ void WaypointSprite_PlayerGone() WaypointSprite_DetachCarrier(self); } #endif +#endif diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 1a799c8de..731cba8ed 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -1,6 +1,5 @@ #include "physics.qh" -#include "triggers/trigger/swamp.qh" -#include "triggers/trigger/jumppads.qh" +#include "triggers/include.qh" #include "viewloc.qh" #ifdef SVQC @@ -11,14 +10,7 @@ // client side physics bool Physics_Valid(string thecvar) { - if(!autocvar_g_physics_clientselect) { return false; } - - string l = strcat(" ", autocvar_g_physics_clientselect_options, " "); - - if(strstrofs(l, strcat(" ", thecvar, " "), 0) >= 0) - return true; - - return false; + return autocvar_g_physics_clientselect && strhasword(autocvar_g_physics_clientselect_options, thecvar); } float Physics_ClientOption(entity pl, string option) diff --git a/qcsrc/common/weapons/all.inc b/qcsrc/common/weapons/all.inc index 3257215a9..fc89a0cd2 100644 --- a/qcsrc/common/weapons/all.inc +++ b/qcsrc/common/weapons/all.inc @@ -27,5 +27,3 @@ #include "weapon/arc.qc" #include "weapon/hmg.qc" #include "weapon/rpc.qc" - -#include "../../server/mutators/gamemode_nexball_weapon.qc" diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 7bf6715f5..e3f6c7e7c 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -150,23 +150,22 @@ REGISTRY_SORT(Weapons, netname, WEP_HARDCODED_IMPULSES + 1) STATIC_INIT(register_weapons_done) { - for (int i = 0; i < Weapons_COUNT; ++i) { - Weapon it = Weapons[i]; + FOREACH(Weapons, true, LAMBDA( it.m_id = i; WepSet set = WepSet_FromWeapon(it.m_id); WEPSET_ALL |= set; if ((it.spawnflags) & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set; it.weapon = it.m_id; it.weapons = set; - #ifdef CSQC - it.wr_init(it); - #endif int imp = WEP_IMPULSE_BEGIN + it.m_id - 1; if (imp <= WEP_IMPULSE_END) localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, imp)); else LOG_TRACEF(_("Impulse limit exceeded, weapon will not be directly accessible: %s\n"), it.netname); - } + )); + #ifdef CSQC + FOREACH(Weapons, true, LAMBDA(it.wr_init(it))); + #endif weaponorder_byid = ""; for (int i = Weapons_MAX - 1; i >= 1; --i) if (Weapons[i]) diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index 739eeb8c9..e222b7df0 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -3,6 +3,7 @@ #include "mutator.qh" +#include "../../common/gamemodes/all.qh" #include "../../common/buffs/all.qh" entity buff_FirstFromFlags(int _buffs) diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 1a07f5e7c..f665fbc13 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -5,6 +5,7 @@ #include "gamemode_keyhunt.qh" #include "gamemode_freezetag.qh" #include "../../common/nades/all.qh" +#include "../../common/gamemodes/all.qh" #include "../../common/monsters/spawn.qh" #include "../../common/monsters/sv_monsters.qh" #include "../g_subs.qh" diff --git a/qcsrc/server/mutators/mutators.qc b/qcsrc/server/mutators/mutators.qc index de32a174e..93fc4cf70 100644 --- a/qcsrc/server/mutators/mutators.qc +++ b/qcsrc/server/mutators/mutators.qc @@ -14,7 +14,6 @@ void mutators_add() CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay); CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1); CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1); - CHECK_MUTATOR_ADD("g_instagib", mutator_instagib, !g_nexball); CHECK_MUTATOR_ADD("g_invincible_projectiles", mutator_invincibleprojectiles, 1); CHECK_MUTATOR_ADD("g_new_toys", mutator_new_toys, !cvar("g_instagib") && !cvar("g_overkill")); CHECK_MUTATOR_ADD("g_nix", mutator_nix, !cvar("g_instagib") && !cvar("g_overkill")); diff --git a/qcsrc/server/mutators/mutators.qh b/qcsrc/server/mutators/mutators.qh index e1355a447..b65cbd2e7 100644 --- a/qcsrc/server/mutators/mutators.qh +++ b/qcsrc/server/mutators/mutators.qh @@ -7,7 +7,6 @@ MUTATOR_DECLARATION(gamemode_keyhunt); MUTATOR_DECLARATION(gamemode_freezetag); MUTATOR_DECLARATION(gamemode_keepaway); MUTATOR_DECLARATION(gamemode_ctf); -MUTATOR_DECLARATION(gamemode_nexball); MUTATOR_DECLARATION(gamemode_onslaught); MUTATOR_DECLARATION(gamemode_domination); MUTATOR_DECLARATION(gamemode_lms); @@ -26,7 +25,6 @@ MUTATOR_DECLARATION(mutator_spawn_near_teammate); MUTATOR_DECLARATION(mutator_physical_items); MUTATOR_DECLARATION(mutator_vampire); MUTATOR_DECLARATION(mutator_superspec); -MUTATOR_DECLARATION(mutator_instagib); MUTATOR_DECLARATION(mutator_touchexplode); MUTATOR_DECLARATION(mutator_pinata); MUTATOR_DECLARATION(mutator_midair); diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index fe8fe0fa5..9d67e03ce 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -85,7 +85,6 @@ #include "gamemode_keepaway.qc" #include "gamemode_keyhunt.qc" #include "gamemode_lms.qc" -#include "gamemode_nexball.qc" #include "gamemode_onslaught.qc" #include "gamemode_race.qc" #include "gamemode_tdm.qc" @@ -96,7 +95,6 @@ #include "mutator_campcheck.qc" #include "mutator_dodging.qc" #include "mutator_hook.qc" -#include "mutator_instagib.qc" #include "mutator_invincibleproj.qc" #include "mutator_melee_only.qc" #include "mutator_midair.qc" diff --git a/qcsrc/server/mutators/mutators_include.qh b/qcsrc/server/mutators/mutators_include.qh index dcd294476..e7144bcd3 100644 --- a/qcsrc/server/mutators/mutators_include.qh +++ b/qcsrc/server/mutators/mutators_include.qh @@ -13,7 +13,6 @@ #include "gamemode_keepaway.qh" #include "gamemode_keyhunt.qh" #include "gamemode_lms.qh" -#include "gamemode_nexball.qh" #include "gamemode_onslaught.qh" #include "gamemode_race.qh" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 2adaf838f..6c48f2f71 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -79,6 +79,7 @@ #include "../common/buffs/all.qc" #include "../common/effects/all.qc" +#include "../common/gamemodes/all.qc" #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 46b82ac65..b279def2f 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -12,6 +12,7 @@ #include "mutators/mutators_include.qh" #include "../common/deathtypes.qh" +#include "../common/gamemodes/all.qh" #include "../common/teams.qh" void TeamchangeFrags(entity e) -- 2.39.2