From 542174a29242af375f7e69c2ef4b4ac4efbaa1b6 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 31 Mar 2021 01:50:14 +0200 Subject: [PATCH] Create the LimitedElectroBallRubbleList intrusive list only when needed, CasingsNGibs only in the client --- qcsrc/common/effects/qc/rubble.qh | 6 ++---- qcsrc/common/weapons/weapon/electro.qc | 2 ++ qcsrc/common/weapons/weapon/electro.qh | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/effects/qc/rubble.qh b/qcsrc/common/effects/qc/rubble.qh index bd75bae01..eccd11282 100644 --- a/qcsrc/common/effects/qc/rubble.qh +++ b/qcsrc/common/effects/qc/rubble.qh @@ -4,12 +4,10 @@ entityclass(Rubble); classfield(Rubble).float creationtime; +#ifdef CSQC IntrusiveList CasingsNGibs; STATIC_INIT(CasingsNGibs) { CasingsNGibs = IL_NEW(); } - -IntrusiveList LimitedElectroBallRubbleList; -STATIC_INIT(LimitedElectroBallRubbleList) { LimitedElectroBallRubbleList = IL_NEW(); } - +#endif void LimitedChildrenRubble(IntrusiveList list, string cname, int limit, void(entity) deleteproc, entity parent); diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 79cfa5ebf..589cf9c77 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -422,6 +422,8 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity) if(WEP_CVAR_SEC(electro, limit) > 0) { + if (!LimitedElectroBallRubbleList) + LimitedElectroBallRubbleList = IL_NEW(); ListNewChildRubble(LimitedElectroBallRubbleList, proj); LimitedChildrenRubble(LimitedElectroBallRubbleList, "electro_orb", WEP_CVAR_SEC(electro, limit), adaptor_think2use_hittype_splash, actor); } diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 2f38024de..9b7c59074 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -77,6 +77,7 @@ REGISTER_WEAPON(ELECTRO, electro, NEW(Electro)); SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO) #ifdef SVQC +IntrusiveList LimitedElectroBallRubbleList; .float electro_count; .float electro_secondarytime; void W_Electro_ExplodeCombo(entity this); -- 2.39.2