From: terencehill Date: Tue, 30 Mar 2021 23:50:14 +0000 (+0200) Subject: Create the LimitedElectroBallRubbleList intrusive list only when needed, CasingsNGibs... X-Git-Tag: xonotic-v0.8.5~475 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=542174a29242af375f7e69c2ef4b4ac4efbaa1b6;p=xonotic%2Fxonotic-data.pk3dir.git Create the LimitedElectroBallRubbleList intrusive list only when needed, CasingsNGibs only in the client --- 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);