]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move thrown nades to the side a bit more
authorMario <mario.mario@y7mail.com>
Sat, 15 Jun 2013 00:57:47 +0000 (10:57 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 15 Jun 2013 00:57:47 +0000 (10:57 +1000)
qcsrc/server/mutators/mutator_nades.qc

index b3588c637466c6151bc1f72755282b78093e2da0..c2db6322f8506ba4f5543adc56edc8b2cb8c9d92 100644 (file)
@@ -82,7 +82,7 @@ void nade_touch()
        PROJECTILE_TOUCH;
        //setsize(self, '-2 -2 -2', '2 2 2');
        //UpdateCSQCProjectile(self);
-       if(self.health == autocvar_g_nades_nade_health)
+       if(self.health == self.max_health)
        {
                spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTN_NORM);
                return;
@@ -107,18 +107,18 @@ void nade_damage(entity inflictor, entity attacker, float damage, float deathtyp
        if(DEATH_ISWEAPON(deathtype, WEP_NEX) || DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
        {
                force *= 6;
-               damage = autocvar_g_nades_nade_health * 0.55;
+               damage = self.max_health * 0.55;
        }
 
        if(DEATH_ISWEAPON(deathtype, WEP_UZI))
-               damage = autocvar_g_nades_nade_health * 0.1;
+               damage = self.max_health * 0.1;
 
        if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && !(deathtype & HITTYPE_SECONDARY))
-               damage = autocvar_g_nades_nade_health * 1.1;
+               damage = self.max_health * 1.1;
                
        if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && (deathtype & HITTYPE_SECONDARY))
        {
-               damage = autocvar_g_nades_nade_health * 0.1;
+               damage = self.max_health * 0.1;
                force *= 15;
        }
        
@@ -127,7 +127,7 @@ void nade_damage(entity inflictor, entity attacker, float damage, float deathtyp
        if(!damage)
                return;
 
-       if(self.health == autocvar_g_nades_nade_health)
+       if(self.health == self.max_health)
        {
                sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
                self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time);
@@ -158,7 +158,7 @@ void toss_nade(entity e, vector _velocity, float _time)
        Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
        
        //setorigin(_nade, CENTER_OR_VIEWOFS(e) + (v_right * 10) * -1);
-       setorigin(_nade, w_shotorg + (v_right * 10) * -1);
+       setorigin(_nade, w_shotorg + (v_right * 25) * -1);
        setmodel(_nade, "models/weapons/v_ok_grenade.md3");
        setattachment(_nade, world, "");
        PROJECTILE_MAKETRIGGER(_nade);
@@ -181,6 +181,7 @@ void toss_nade(entity e, vector _velocity, float _time)
        //_nade.solid = SOLID_BBOX; // TODO: remember why this was needed
        _nade.touch = nade_touch;
        _nade.health = autocvar_g_nades_nade_health;
+       _nade.max_health = _nade.health;
        _nade.takedamage = DAMAGE_AIM;
        _nade.event_damage = nade_damage;
        _nade.teleportable = TRUE;