From da6c1794335bea9e2395e1745f5607cab7c0f73b Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 10 Feb 2024 15:02:02 +0100 Subject: [PATCH] Menu: remove useless registries and related code (TempEntities, LinkedEntities, C2S_Protocol) and fix a couple registries not matching the corresponding client/server versions (Buff entry was missing from the RadarIcons and Waypoints registries) --- qcsrc/common/gamemodes/gamemode/survival/survival.qc | 3 +++ qcsrc/common/mutators/mutator/buffs/buffs.qh | 5 ----- qcsrc/common/mutators/mutator/damagetext/damagetext.qc | 2 ++ qcsrc/common/mutators/mutator/itemstime/itemstime.qc | 2 ++ qcsrc/common/mutators/mutator/nades/nades.qc | 4 +++- qcsrc/common/mutators/mutator/waypoints/all.inc | 2 ++ qcsrc/common/mutators/mutator/waypoints/all.qh | 1 + qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc | 2 ++ qcsrc/common/weapons/weapon/shockwave.qc | 2 ++ qcsrc/common/weapons/weapon/vaporizer.qc | 2 ++ qcsrc/common/weapons/weapon/vortex.qc | 2 ++ qcsrc/lib/net.qh | 6 +++++- qcsrc/lib/registry_net.qh | 2 ++ 13 files changed, 28 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/survival/survival.qc b/qcsrc/common/gamemodes/gamemode/survival/survival.qc index a8a67ad44..26191ad9c 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/survival.qc +++ b/qcsrc/common/gamemodes/gamemode/survival/survival.qc @@ -1,2 +1,5 @@ #include "survival.qh" + +#ifdef GAMEQC REGISTER_NET_LINKED(ENT_CLIENT_SURVIVALSTATUSES) +#endif diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qh b/qcsrc/common/mutators/mutator/buffs/buffs.qh index ae465dfdb..a14ad6bb8 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qh @@ -8,11 +8,6 @@ #include #endif -#ifdef GAMEQC -REGISTER_WAYPOINT(Buff, _("Buff"), "", '1 0.5 0', 1); -REGISTER_RADARICON(Buff, 1); -#endif - #define REGISTER_BUFF(id, inst) \ REGISTER(StatusEffect, BUFF_##id, m_id, inst) diff --git a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc index 7cdd567f1..0ed133530 100644 --- a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc @@ -1,3 +1,5 @@ #include "damagetext.qh" +#ifdef GAMEQC REGISTER_NET_LINKED(damagetext) +#endif diff --git a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc index 19045727b..5aa59bffc 100644 --- a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc @@ -2,7 +2,9 @@ REGISTER_MUTATOR(itemstime, true); +#ifdef GAMEQC REGISTER_NET_TEMP(itemstime) +#endif #ifdef SVQC void IT_Write(entity e, int i, float f) { diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 01f78c05b..3f9e54cdb 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -37,9 +37,11 @@ entity Nade_TrailEffect(int proj, int nade_team) return EFFECT_Null; } -#endif REGISTER_NET_TEMP(TE_CSQC_DARKBLINKING); + +#endif + #ifdef CSQC #include #include diff --git a/qcsrc/common/mutators/mutator/waypoints/all.inc b/qcsrc/common/mutators/mutator/waypoints/all.inc index 98b1f4d3c..50664831a 100644 --- a/qcsrc/common/mutators/mutator/waypoints/all.inc +++ b/qcsrc/common/mutators/mutator/waypoints/all.inc @@ -71,3 +71,5 @@ REGISTER_WAYPOINT(Vehicle, _("Vehicle"), "", '1 1 1', 1); REGISTER_WAYPOINT(VehicleIntruder, _("Intruder!"), "", '1 1 1', 1); REGISTER_WAYPOINT(Seeker, _("Tagged"), "", '0.5 1 0', 2); + +REGISTER_WAYPOINT(Buff, _("Buff"), "", '1 0.5 0', 1); diff --git a/qcsrc/common/mutators/mutator/waypoints/all.qh b/qcsrc/common/mutators/mutator/waypoints/all.qh index fa1cbd31a..b5f5f161d 100644 --- a/qcsrc/common/mutators/mutator/waypoints/all.qh +++ b/qcsrc/common/mutators/mutator/waypoints/all.qh @@ -58,5 +58,6 @@ REGISTER_RADARICON(TAGGED, 1); REGISTER_RADARICON(Item, 1); REGISTER_RADARICON(Vehicle, 1); REGISTER_RADARICON(Weapon, 1); +REGISTER_RADARICON(Buff, 1); #include "all.inc" diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index f19fc059e..0625f412e 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -2,7 +2,9 @@ REGISTER_MUTATOR(waypointsprites, true); +#ifdef GAMEQC REGISTER_NET_LINKED(waypointsprites) +#endif #ifdef SVQC bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index bd4e5975a..b41a14f34 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -1,6 +1,8 @@ #include "shockwave.qh" +#ifdef GAMEQC REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE) +#endif #ifdef SVQC diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 4be54b6b2..9ca0b3192 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -1,6 +1,8 @@ #include "vaporizer.qh" +#ifdef GAMEQC REGISTER_NET_TEMP(TE_CSQC_VAPORBEAMPARTICLE) +#endif #if defined(SVQC) void SendCSQCVaporizerBeamParticle(entity player, int hit) { diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 4d4e43ec6..d9cacac00 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -24,7 +24,9 @@ METHOD(Vortex, wr_glow, vector(Vortex this, int actor_colors, entity wepent)) } #endif +#ifdef GAMEQC REGISTER_NET_TEMP(TE_CSQC_VORTEXBEAMPARTICLE) +#endif #if defined(SVQC) void SendCSQCVortexBeamParticle(float charge) { diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index c9cdf6981..7c490fd15 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -7,6 +7,9 @@ // netcode mismatch and not sure what caused it? developer_csqcentities 1 .string netname; + +#ifdef GAMEQC + .int m_id; .bool(entity this, entity sender, bool isNew) m_read; #define NET_HANDLE(id, param) bool Net_Handle_##id(entity this, entity sender, param) @@ -37,7 +40,6 @@ string _net_prevmsgstr; this.netname = #id; \ } #endif -#define REGISTER_NET_S2C(id) REGISTER_NET_TEMP(id) REGISTRY(TempEntities, BITS(8) - 80) REGISTER_REGISTRY(TempEntities) @@ -107,6 +109,8 @@ REGISTRY_CHECK(C2S_Protocol) REGISTRY_DEFINE_GET(C2S_Protocol, NULL) STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } +#endif // GAMEQC + #ifdef SVQC const int MSG_ENTITY = 5; diff --git a/qcsrc/lib/registry_net.qh b/qcsrc/lib/registry_net.qh index 6c947d7c5..1c5b04342 100644 --- a/qcsrc/lib/registry_net.qh +++ b/qcsrc/lib/registry_net.qh @@ -2,7 +2,9 @@ #include "net.qh" +#ifdef GAMEQC REGISTER_NET_TEMP(registry) +#endif #ifdef CSQC NET_HANDLE(registry, bool isnew) -- 2.39.2