]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Create the LimitedElectroBallRubbleList intrusive list only when needed, CasingsNGibs...
authorterencehill <piuntn@gmail.com>
Tue, 30 Mar 2021 23:50:14 +0000 (01:50 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 30 Mar 2021 23:50:14 +0000 (01:50 +0200)
qcsrc/common/effects/qc/rubble.qh
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh

index bd75bae019425e016553c584da070ac5ea0b6376..eccd11282a46eb76d74e5b5a789b0a33a0a390c8 100644 (file)
@@ -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);
 
index 79cfa5ebf9fe124988afddc909cb0f4ba5a7a1aa..589cf9c773521d534c147d7a33104750945ff5bb 100644 (file)
@@ -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);
        }
index 2f38024de0f74f233bee7209c9c9ea5773e1f18d..9b7c59074fe8dc04fa9042b0f4838d062e956479 100644 (file)
@@ -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);