X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=1e1ce3eede1b1b429aae7fbd53e9264eb8dce530;hb=dd2b9a194fa4b844241392bfc136b953abf94a7a;hp=6232db886e7a810c8f72b403803fb5c202563e77;hpb=f34e36384aea3cb5e6c6818de704e6da2ee125b5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 6232db886..1e1ce3eed 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -35,7 +35,7 @@ #include #include #include - #include "../notifications.qh" + #include "../notifications/all.qh" #include "../deathtypes/all.qh" #include #include "../mapinfo.qh" @@ -134,7 +134,7 @@ string W_NumberWeaponOrder_MapFunc(string s) { if (s == "0" || stof(s)) return s; s = W_UndeprecateName(s); - FOREACH(Weapons, it != WEP_Null && it.netname == s, LAMBDA(return ftos(i))); + FOREACH(Weapons, it != WEP_Null && it.netname == s, return ftos(i)); return s; } string W_NumberWeaponOrder(string order) @@ -181,7 +181,7 @@ string W_FixWeaponOrder_BuildImpulseList(string o) return substring(o, 1, -1); } -string W_FixWeaponOrder_AllowIncomplete(string order) +string W_FixWeaponOrder_AllowIncomplete(entity this, string order) { return W_FixWeaponOrder(order, 0); } @@ -202,10 +202,10 @@ void W_RandomWeapons(entity e, float n) for (i = 0; i < n; ++i) { RandomSelection_Init(); - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { if (remaining & (it.m_wepset)) RandomSelection_Add(it, 0, string_null, 1, 1); - )); + }); Weapon w = RandomSelection_chosen_ent; result |= WepSet_FromWeapon(w); remaining &= ~WepSet_FromWeapon(w); @@ -262,7 +262,7 @@ string W_Sound(string w_snd) string output = strcat("weapons/", w_snd); #ifdef SVQC MUTATOR_CALLHOOK(WeaponSound, w_snd, output); - return weapon_sound_output; + return M_ARGV(1, string); #else return output; #endif @@ -387,7 +387,7 @@ vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn * call again with "" * remove the ent */ -void CL_WeaponEntity_SetModel(entity this, string name) +void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) { if (name == "") { @@ -425,7 +425,6 @@ void CL_WeaponEntity_SetModel(entity this, string name) if (!this.weaponchild) { this.weaponchild = new(weaponchild); - make_pure(this.weaponchild); #ifdef CSQC this.weaponchild.drawmask = MASK_NORMAL; this.weaponchild.renderflags |= RF_VIEWMODEL; @@ -541,6 +540,7 @@ void CL_WeaponEntity_SetModel(entity this, string name) // check if an instant weapon switch occurred setorigin(this, this.view_ofs); + if (!_anim) return; // reset animstate now this.wframe = WFRAME_IDLE; setanim(this, this.anim_idle, true, false, true);