]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
start of force-setting HITTYPE_SPLASH for timed out explosions (so client/damage...
authorRudolf Polzer <divverent@alientrap.org>
Wed, 26 May 2010 05:39:18 +0000 (07:39 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 26 May 2010 05:39:18 +0000 (07:39 +0200)
qcsrc/server/miscfunctions.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc

index c54235d2cbdbc1a8ffe493209a72a4681cda8f5c..ac0bc8f6338fd0ae04a47ae8c4684701114788f7 100644 (file)
@@ -1916,6 +1916,13 @@ void adaptor_think2use()
     activator = a;
 }
 
+void adaptor_think2use_hittype_splash() // for timed projectile detonation
+{
+       if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+               self.projectiledeathtype |= HITTYPE_SPLASH;
+       adaptor_think2use();
+}
+
 // deferred dropping
 void DropToFloor_Handler()
 {
index c1cb49d0ebb896c4b50f3985e95bb7eeb704a38a..c9e7d23c31eff0682d56453b594b2cfdbd115481 100644 (file)
@@ -51,7 +51,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 +97,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 +116,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 +150,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");
index c1d30ba0211f53bbd9297b4bcf2a96797a8a5851..0462cd9018b256f0febe222f9e415b3c164e3a2c 100644 (file)
@@ -98,6 +98,7 @@ void W_Fireball_Think()
        if(time > self.pushltime)
        {
                self.cnt = 1;
+               self.projectiledeathtype |= HITTYPE_SPLASH;
                W_Fireball_Explode();
                return;
        }
index 380e849fe35c276d259d84e7d76b1c398edb6d09..251137401c4a0580d934da6f6b4949313131ed59 100644 (file)
@@ -99,7 +99,7 @@ void W_Grenade_Attack (void)
        setsize(gren, '0 0 -3', '0 0 -3');
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
-       gren.think = adaptor_think2use;
+       gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Grenade_Explode;
        gren.touch = W_Grenade_Touch1;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
@@ -135,7 +135,7 @@ void W_Grenade_Attack2 (void)
        setorigin(gren, w_shotorg);
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
-       gren.think = adaptor_think2use;
+       gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Grenade_Explode2;
        gren.touch = W_Grenade_Touch2;
        gren.takedamage = DAMAGE_YES;