give grenades a size too (6x6x6) like rockets;
authorRudolf Polzer <divverent@alientrap.org>
Thu, 26 Aug 2010 05:33:35 +0000 (07:33 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 26 Aug 2010 05:33:35 +0000 (07:33 +0200)
fix visual issue with grenade explosion appearing on the wrong side of a wall

qcsrc/client/interpolate.qc
qcsrc/client/projectile.qc
qcsrc/server/w_grenadelauncher.qc

index 5593570..5ee28b0 100644 (file)
@@ -24,7 +24,8 @@ void InterpolateOrigin_Note()
        self.iorigin2 = self.origin;
 
        if(self.iflags & IFLAG_AUTOANGLES)
        self.iorigin2 = self.origin;
 
        if(self.iflags & IFLAG_AUTOANGLES)
-               self.angles = vectoangles(self.iorigin2 - self.iorigin1);
+               if(self.iorigin2 != self.iorigin1)
+                       self.angles = vectoangles(self.iorigin2 - self.iorigin1);
 
        if(self.iflags & IFLAG_ANGLES)
        {
 
        if(self.iflags & IFLAG_ANGLES)
        {
index 407b86c..9a77337 100644 (file)
@@ -72,7 +72,8 @@ void Projectile_Draw()
                else
                        Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
                if(!(self.move_flags & FL_ONGROUND))
                else
                        Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
                if(!(self.move_flags & FL_ONGROUND))
-                       self.angles = vectoangles(self.velocity);
+                       if(self.velocity != '0 0 0')
+                               self.angles = vectoangles(self.velocity);
        }
        else
        {
        }
        else
        {
@@ -318,12 +319,12 @@ void Ent_Projectile()
                                self.maxs = '3 3 3';
                                break;
                        case PROJECTILE_GRENADE:
                                self.maxs = '3 3 3';
                                break;
                        case PROJECTILE_GRENADE:
-                               self.mins = '0 0 -3';
-                               self.maxs = '0 0 -3';
+                               self.mins = '-3 -3 -3';
+                               self.maxs = '3 3 3';
                                break;
                        case PROJECTILE_GRENADE_BOUNCING:
                                break;
                        case PROJECTILE_GRENADE_BOUNCING:
-                               self.mins = '0 0 -3';
-                               self.maxs = '0 0 -3';
+                               self.mins = '-3 -3 -3';
+                               self.maxs = '3 3 3';
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = SUB_Null;
                                self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = SUB_Null;
                                self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;
index 6848b2a..64a9870 100644 (file)
@@ -32,6 +32,10 @@ void W_Grenade_Explode2 (void)
 
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
 
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
+
+       if(self.movetype == MOVETYPE_NONE)
+               self.velocity = self.oldvelocity;
+
        RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_secondary_damage"), cvar("g_balance_grenadelauncher_secondary_edgedamage"), cvar("g_balance_grenadelauncher_secondary_radius"), world, cvar("g_balance_grenadelauncher_secondary_force"), self.projectiledeathtype, other);
 
        remove (self);
        RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_secondary_damage"), cvar("g_balance_grenadelauncher_secondary_edgedamage"), cvar("g_balance_grenadelauncher_secondary_radius"), world, cvar("g_balance_grenadelauncher_secondary_force"), self.projectiledeathtype, other);
 
        remove (self);
@@ -123,7 +127,7 @@ void W_Grenade_Attack (void)
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
-       W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_primary_damage"));
+       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_primary_damage"));
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -137,7 +141,7 @@ void W_Grenade_Attack (void)
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
        setorigin(gren, w_shotorg);
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
        setorigin(gren, w_shotorg);
-       setsize(gren, '0 0 -3', '0 0 -3');
+       setsize(gren, '-3 -3 -3', '3 3 3');
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
        gren.think = adaptor_think2use_hittype_splash;
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
        gren.think = adaptor_think2use_hittype_splash;
@@ -177,7 +181,7 @@ void W_Grenade_Attack2 (void)
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
-       setsize(gren, '0 0 -3', '0 0 -3');
+       setsize(gren, '-3 -3 -3', '3 3 3');
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
        gren.think = adaptor_think2use_hittype_splash;
 
        gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
        gren.think = adaptor_think2use_hittype_splash;