X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fnades%2Fnades.qc;h=24d8c87cc0cbbfe1ca97ab8c0ec962c1160b430d;hb=05c1916e1f78c8233a0eb88b5f619d31ac5c9569;hp=6ec9c23213f132f95e95993202b74494422f3ce2;hpb=c17146a306030f59d8b161e5f0f7f1f561f3d340;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 6ec9c2321..24d8c87cc 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -736,7 +736,7 @@ void nade_boom(entity this) IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this, { - RemoveGrapplingHook(it.realowner); + RemoveHook(it); }); delete(this); @@ -785,7 +785,7 @@ void nade_touch(entity this, entity toucher) { IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this, { - RemoveGrapplingHook(it.realowner); + RemoveHook(it); }); delete(this); return; @@ -891,7 +891,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) makevectors(e.v_angle); // NOTE: always throw from first weapon entity? - W_SetupShot(e, weaponentities[0], false, false, SND_Null, CH_WEAPON_A, 0); + W_SetupShot(e, _nade.weaponentity_fld, false, false, SND_Null, CH_WEAPON_A, 0); Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES); @@ -1034,6 +1034,8 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin if(Nades_from(n.nade_type) == NADE_TYPE_Null) n.nade_type = NADE_TYPE_NORMAL.m_id; + .entity weaponentity = weaponentities[0]; // TODO: unhardcode + setmodel(n, MDL_PROJECTILE_NADE); //setattachment(n, player, "bip01 l hand"); n.exteriormodeltoclient = player; @@ -1048,9 +1050,9 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin setthink(n, nade_beep); n.nextthink = max(n.wait - 3, time); n.projectiledeathtype = DEATH_NADE.m_id; + n.weaponentity_fld = weaponentity; setmodel(fn, MDL_NADE_VIEW); - .entity weaponentity = weaponentities[0]; // TODO: unhardcode setattachment(fn, player.(weaponentity), ""); fn.realowner = fn.owner = player; fn.colormod = Nades_from(n.nade_type).m_color; @@ -1058,6 +1060,7 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin fn.glowmod = player.glowmod; setthink(fn, SUB_Remove); fn.nextthink = n.wait; + fn.weaponentity_fld = weaponentity; player.nade = n; player.fake_nade = fn;