From: Mario Date: Mon, 16 Mar 2015 20:58:02 +0000 (+1100) Subject: Add a setting to handle nade throwing offset, defaulting to -20 (seems to work well) X-Git-Tag: xonotic-v0.8.1~97^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e10293f61aa931855a209297294500b0f1740ab;p=xonotic%2Fxonotic-data.pk3dir.git Add a setting to handle nade throwing offset, defaulting to -20 (seems to work well) --- diff --git a/mutators.cfg b/mutators.cfg index a803d8411..86728648f 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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 diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index bcb9d28d7..015c13f14 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 3932ce407..ce6ee85cd 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -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);