#include "all.qh"
#if defined(CSQC)
- #include "../../client/defs.qh"
+ #include <client/defs.qh>
#include "../constants.qh"
#include "../stats.qh"
- #include "../../lib/warpzone/anglestransform.qh"
- #include "../../lib/warpzone/common.qh"
- #include "../../lib/warpzone/client.qh"
+ #include <lib/warpzone/anglestransform.qh>
+ #include <lib/warpzone/common.qh>
+ #include <lib/warpzone/client.qh>
#include "../util.qh"
- #include "../../client/autocvars.qh"
+ #include <client/autocvars.qh>
#include "../deathtypes/all.qh"
- #include "../../lib/csqcmodel/interpolate.qh"
+ #include <lib/csqcmodel/interpolate.qh>
#include "../physics/movetypes/movetypes.qh"
- #include "../../client/main.qh"
- #include "../../lib/csqcmodel/cl_model.qh"
+ #include <client/main.qh>
+ #include <lib/csqcmodel/cl_model.qh>
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../lib/warpzone/anglestransform.qh"
- #include "../../lib/warpzone/common.qh"
- #include "../../lib/warpzone/util_server.qh"
- #include "../../lib/warpzone/server.qh"
+ #include <lib/warpzone/anglestransform.qh>
+ #include <lib/warpzone/common.qh>
+ #include <lib/warpzone/util_server.qh>
+ #include <lib/warpzone/server.qh>
#include "../constants.qh"
#include "../stats.qh"
#include "../teams.qh"
#include "../util.qh"
#include "../monsters/all.qh"
#include "config.qh"
- #include "../../server/weapons/csqcprojectile.qh"
- #include "../../server/weapons/tracing.qh"
- #include "../../server/t_items.qh"
- #include "../../server/autocvars.qh"
- #include "../../server/constants.qh"
- #include "../../server/defs.qh"
- #include "../notifications.qh"
+ #include <server/weapons/csqcprojectile.qh>
+ #include <server/weapons/tracing.qh>
+ #include "../t_items.qh"
+ #include <server/autocvars.qh>
+ #include <server/constants.qh>
+ #include <server/defs.qh>
+ #include "../notifications/all.qh"
#include "../deathtypes/all.qh"
- #include "../../server/mutators/all.qh"
+ #include <server/mutators/all.qh>
#include "../mapinfo.qh"
- #include "../../server/command/common.qh"
- #include "../../lib/csqcmodel/sv_model.qh"
- #include "../../server/portals.qh"
- #include "../../server/g_hook.qh"
+ #include <server/command/common.qh>
+ #include <lib/csqcmodel/sv_model.qh>
+ #include <server/portals.qh>
+ #include <server/g_hook.qh>
#endif
#ifndef MENUQC
#include "calculations.qc"
{
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)
return substring(o, 1, -1);
}
-string W_FixWeaponOrder_AllowIncomplete(string order)
+string W_FixWeaponOrder_AllowIncomplete(entity this, string order)
{
return W_FixWeaponOrder(order, 0);
}
void W_RandomWeapons(entity e, float n)
{
- int i, j;
+ int i;
WepSet remaining;
WepSet result;
remaining = e.weapons;
for (i = 0; i < n; ++i)
{
RandomSelection_Init();
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
- if (remaining & WepSet_FromWeapon(Weapons_from(j))) RandomSelection_Add(NULL, j, string_null, 1, 1);
- Weapon w = Weapons_from(RandomSelection_chosen_float);
+ 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);
}
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
{
string output = strcat("models/weapons/", w_mdl);
MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
- return weapon_model_output;
+ return M_ARGV(1, string);
}
#ifndef MENUQC
* 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 == "")
{
if (!this.weaponchild)
{
this.weaponchild = new(weaponchild);
- make_pure(this.weaponchild);
#ifdef CSQC
this.weaponchild.drawmask = MASK_NORMAL;
this.weaponchild.renderflags |= RF_VIEWMODEL;
#endif
}
_setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
+ setsize(this.weaponchild, '0 0 0', '0 0 0');
setattachment(this.weaponchild, this, t);
}
else
this.weaponchild = NULL;
}
+ setsize(this, '0 0 0', '0 0 0');
setorigin(this, '0 0 0');
this.angles = '0 0 0';
this.frame = 0;
// 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);