]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cleanup nade offset
authorMartin Taibr <taibr.martin@gmail.com>
Mon, 7 Aug 2017 02:54:48 +0000 (04:54 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Mon, 7 Aug 2017 02:54:48 +0000 (04:54 +0200)
mutators.cfg
qcsrc/common/mutators/mutator/nades/nades.qc

index 9e8460da15ad4dbcfcc3edf24802e65eaf02a3a4..33076b5622e8e0a58fd9ae9e70543ef8ec92d9eb 100644 (file)
@@ -176,7 +176,7 @@ set g_random_gravity_negative 1000 "negative gravity multiplier"
 // =======
 set g_nades 0 "enable off-hand grenades"
 set g_nades_spread 0.04 "random spread offset of throw direction"
-set g_nades_throw_offset "0 0 0" "nade throwing offset"
+set g_nades_throw_offset "0 -25 0" "nade throwing offset" // TODO find something that doesn't bounce off floor edges for OK promode
 set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
 set g_nades_client_select 0 "allow client side selection of nade type"
 set g_nades_pickup 0 "allow picking up thrown nades (not your own)"
index 77286eac5d4ca9cdde169e743e5f1366dc12c0e4..23ee565b221bc5be7443dd5134d16640af45ed71 100644 (file)
@@ -889,20 +889,18 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
        delete(e.fake_nade);
        e.fake_nade = NULL;
 
+       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
+
        makevectors(e.v_angle);
 
        // NOTE: always throw from first weapon entity?
        W_SetupShot(e, _nade.weaponentity_fld, false, false, SND_Null, CH_WEAPON_A, 0);
 
-       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
-
        vector offset = (v_forward * autocvar_g_nades_throw_offset.x)
-                                 + (v_right * autocvar_g_nades_throw_offset.y)
-                                 + (v_up * autocvar_g_nades_throw_offset.z);
-       if(autocvar_g_nades_throw_offset == '0 0 0')
-               offset = '0 0 0';
+                     + (v_right * autocvar_g_nades_throw_offset.y)
+                     + (v_up * autocvar_g_nades_throw_offset.z);
 
-       setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
+       setorigin(_nade, w_shotorg + offset);
        //setmodel(_nade, MDL_PROJECTILE_NADE);
        //setattachment(_nade, NULL, "");
        PROJECTILE_MAKETRIGGER(_nade);