]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a setting to handle nade throwing offset, defaulting to -20 (seems to work well)
authorMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 20:58:02 +0000 (07:58 +1100)
committerMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 20:58:02 +0000 (07:58 +1100)
mutators.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/mutator_nades.qc

index a803d8411011cb7e52f737bd6b0553eaa6cee958..86728648fe355009905e4b5ccaaa235aa8d60b28 100644 (file)
@@ -175,6 +175,7 @@ set g_random_gravity_negative 1000 "negative gravity multiplier"
 //  Nades
 // =======
 set g_nades 0 "enable off-hand grenades"
+set g_nades_throw_offset "0 -20 0" "nade throwing offset"
 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_nade_lifetime 3.5
index bcb9d28d70240e779e942a25b3c5764e7252298a..015c13f148c56e93b7c27ef9519de321165073f4 100644 (file)
@@ -785,6 +785,7 @@ float autocvar_g_random_gravity_positive;
 float autocvar_g_random_gravity_negative;
 float autocvar_g_random_gravity_delay;
 float autocvar_g_nades;
+vector autocvar_g_nades_throw_offset;
 float autocvar_g_nades_spawn;
 float autocvar_g_nades_spawn_count;
 float autocvar_g_nades_client_select;
index 3932ce407d885c2ccb01d7c5f0a236aceac775a2..ce6ee85cda6833305133f73913f316714720392c 100644 (file)
@@ -666,7 +666,13 @@ void toss_nade(entity e, vector _velocity, float _time)
 
        Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
 
-       setorigin(_nade, w_shotorg + (v_right * 25) * -1);
+       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';
+
+       setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
        //setmodel(_nade, "models/weapons/v_ok_grenade.md3");
        //setattachment(_nade, world, "");
        PROJECTILE_MAKETRIGGER(_nade);