]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_electro.qc
allow weapon files to define functions in csqc too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_electro.qc
index c1cb49d0ebb896c4b50f3985e95bb7eeb704a38a..7c61599aeeedcca146dfd971d5d026d71f432974 100644 (file)
@@ -1,6 +1,7 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "electro", "electro", "Electro");
 #else
+#ifdef SVQC
 .float electro_count;
 .float electro_secondarytime;
 
@@ -51,7 +52,6 @@ void W_Plasma_Explode (void)
 
 void W_Plasma_Explode_Combo (void)
 {
-
        W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_combo_comboradius"), self.owner);
 
        self.event_damage = SUB_Null;
@@ -98,7 +98,7 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea
                else
                {
                        self.use = W_Plasma_Explode;
-                       self.think = adaptor_think2use;
+                       self.think = adaptor_think2use; // not _hittype_splash, as this runs "immediately"
                }
        }
 }
@@ -117,7 +117,7 @@ void W_Electro_Attack()
        proj.bot_dodge = TRUE;
        proj.bot_dodgerating = cvar("g_balance_electro_primary_damage");
        proj.use = W_Plasma_Explode;
-       proj.think = adaptor_think2use;
+       proj.think = adaptor_think2use_hittype_splash;
        proj.nextthink = time + cvar("g_balance_electro_primary_lifetime");
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_ELECTRO;
@@ -151,7 +151,7 @@ void W_Electro_Attack2()
        proj.classname = "plasma";
        proj.owner = self;
        proj.use = W_Plasma_Explode;
-       proj.think = adaptor_think2use;
+       proj.think = adaptor_think2use_hittype_splash;
        proj.bot_dodge = TRUE;
        proj.bot_dodgerating = cvar("g_balance_electro_secondary_damage");
        proj.nextthink = time + cvar("g_balance_electro_secondary_lifetime");
@@ -318,3 +318,6 @@ float w_electro(float req)
        return TRUE;
 };
 #endif
+#ifdef CSQC
+#endif
+#endif