From: Mario Date: Fri, 27 Mar 2015 08:15:05 +0000 (+0000) Subject: Merge branch 'Mario/nade_fixes' into 'master' X-Git-Tag: xonotic-v0.8.1~97 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=49e9b4a216bb11b70b988c5490156f2dba0aafd5;hp=f746573dff0cedc83aa8254751fe0e6d829efc93 Merge branch 'Mario/nade_fixes' into 'master' Merge branch Mario/nade_fixes (M merge request) Fixes nades disappearing when touching clips, allows dropping the nade down only when player is both looking down and holding crouch, fixes ultra fast overkill superweapon re-spawn times, adds an option to change the nade throw offset (possibly useful for servers that wish to attempt to reproduce the old overkill's nade throw offsets). See merge request !112 --- diff --git a/mutators.cfg b/mutators.cfg index a803d84110..2960588ff6 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -41,7 +41,7 @@ set g_overkill 0 "enable overkill" set g_overkill_100a_anyway 1 set g_overkill_100h_anyway 1 set g_overkill_powerups_replace 1 -set g_overkill_superguns_respawn_time 20 +set g_overkill_superguns_respawn_time 120 set g_overkill_ammo_charge 0 set g_overkill_ammo_charge_notice 1 @@ -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 0 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 bcb9d28d70..015c13f148 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 3932ce407d..60b2acce56 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -551,12 +551,12 @@ void nade_boom() void nade_touch() { - float is_weapclip = 0; + /*float is_weapclip = 0; if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW) if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)) if (!(trace_dphitcontents & DPCONTENTS_OPAQUE)) - is_weapclip = 1; - if(ITEM_TOUCH_NEEDKILL() || is_weapclip) + is_weapclip = 1;*/ + if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip) { remove(self); return; @@ -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); @@ -677,7 +683,7 @@ void toss_nade(entity e, vector _velocity, float _time) if (trace_startsolid) setorigin(_nade, e.origin); - if(self.v_angle.x >= 70 && self.v_angle.x <= 110) + if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && self.BUTTON_CROUCH) _nade.velocity = '0 0 100'; else if(autocvar_g_nades_nade_newton_style == 1) _nade.velocity = e.velocity + _velocity;