6 #include <client/autocvars.qh>
7 #include <client/main.qh>
8 #include <common/constants.qh>
9 #include <common/deathtypes/all.qh>
10 #include <common/physics/movetypes/movetypes.qh>
11 #include <common/stats.qh>
12 #include <common/util.qh>
13 #include <common/weapons/calculations.qc>
14 #include <common/weapons/weapon/_mod.inc>
15 #include <lib/csqcmodel/cl_model.qh>
16 #include <lib/csqcmodel/interpolate.qh>
17 #include <lib/warpzone/anglestransform.qh>
18 #include <lib/warpzone/client.qh>
19 #include <lib/warpzone/common.qh>
21 #include <common/weapons/weapon/_mod.inc>
23 #include <common/constants.qh>
24 #include <common/deathtypes/all.qh>
25 #include <common/items/_mod.qh>
26 #include <common/mapinfo.qh>
27 #include <common/monsters/_mod.qh>
28 #include <common/notifications/all.qh>
29 #include <common/stats.qh>
30 #include <common/teams.qh>
31 #include <common/util.qh>
32 #include <common/weapons/calculations.qc>
33 #include <common/weapons/config.qc>
34 #include <common/weapons/config.qh>
35 #include <common/weapons/weapon/_mod.inc>
36 #include <lib/csqcmodel/sv_model.qh>
37 #include <lib/warpzone/anglestransform.qh>
38 #include <lib/warpzone/common.qh>
39 #include <lib/warpzone/server.qh>
40 #include <lib/warpzone/util_server.qh>
41 #include <server/autocvars.qh>
42 #include <server/command/_mod.qh>
43 #include <server/hook.qh>
44 #include <server/items/spawning.qh>
45 #include <server/mutators/_mod.qh>
46 #include <server/portals.qh>
47 #include <server/weapons/common.qh>
48 #include <server/weapons/csqcprojectile.qh>
49 #include <server/weapons/tracing.qh>
53 // WEAPON PLUGIN SYSTEM
55 WepSet _WepSet_FromWeapon(int a)
58 if (REGISTRY_MAX(Weapons) > 24)
62 if (REGISTRY_MAX(Weapons) > 48)
66 return '0 0 1' * (2 ** a);
68 return '0 1 0' * (2 ** a);
70 return '1 0 0' * (2 ** a);
73 void WriteWepSet(float dst, WepSet w)
75 if (REGISTRY_MAX(Weapons) > 48) WriteInt72_t(dst, w);
76 else if (REGISTRY_MAX(Weapons) > 24) WriteInt48_t(dst, w);
77 else WriteInt24_t(dst, w.x);
81 WepSet WepSet_GetFromStat()
85 WepSet WepSet_GetFromStat_InMap()
87 return STAT(WEAPONSINMAP);
91 if (REGISTRY_MAX(Weapons) > 48) return ReadInt72_t();
92 if (REGISTRY_MAX(Weapons) > 24) return ReadInt48_t();
93 return ReadInt24_t() * '1 0 0';
97 string W_FixWeaponOrder(string order, float complete)
99 return fixPriorityList(order, WEP_FIRST, WEP_LAST, WEP_IMPULSE_BEGIN - WEP_FIRST, complete);
101 string W_NameWeaponOrder_MapFunc(string s)
106 entity wi = REGISTRY_GET(Weapons, i);
107 if (wi != WEP_Null) return wi.netname;
112 string W_UndeprecateName(string s)
116 case "nex": return "vortex";
117 case "rocketlauncher": return "devastator";
118 case "laser": return "blaster";
119 case "minstanex": return "vaporizer";
120 case "grenadelauncher": return "mortar";
121 case "uzi": return "machinegun";
122 case "hmg": return "okhmg";
123 case "rpc": return "okrpc";
127 string W_NameWeaponOrder(string order)
129 return mapPriorityList(order, W_NameWeaponOrder_MapFunc);
131 string W_NumberWeaponOrder_MapFunc(string s)
133 if (s == "0" || stof(s)) return s;
134 s = W_UndeprecateName(s);
135 FOREACH(Weapons, it != WEP_Null && it.netname == s, return ftos(i));
138 string W_NumberWeaponOrder(string order)
140 return mapPriorityList(order, W_NumberWeaponOrder_MapFunc);
143 float W_FixWeaponOrder_BuildImpulseList_buf[REGISTRY_MAX(Weapons)];
144 string W_FixWeaponOrder_BuildImpulseList_order;
145 void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass)
148 h = W_FixWeaponOrder_BuildImpulseList_buf[i];
149 W_FixWeaponOrder_BuildImpulseList_buf[i] = W_FixWeaponOrder_BuildImpulseList_buf[j];
150 W_FixWeaponOrder_BuildImpulseList_buf[j] = h;
152 float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
154 int si = W_FixWeaponOrder_BuildImpulseList_buf[i];
155 Weapon e1 = REGISTRY_GET(Weapons, si);
156 int sj = W_FixWeaponOrder_BuildImpulseList_buf[j];
157 Weapon e2 = REGISTRY_GET(Weapons, sj);
158 int d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10;
159 if (d != 0) return -d; // high impulse first!
160 string s = strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " ");
161 return strstrofs(s, sprintf(" %d ", si), 0)
162 - strstrofs(s, sprintf(" %d ", sj), 0); // low char index first!
164 string W_FixWeaponOrder_BuildImpulseList(string o)
167 W_FixWeaponOrder_BuildImpulseList_order = o;
168 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
169 W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i;
170 heapsort(WEP_LAST - WEP_FIRST + 1, W_FixWeaponOrder_BuildImpulseList_swap, W_FixWeaponOrder_BuildImpulseList_cmp,
173 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
174 o = strcat(o, " ", ftos(W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST]));
175 W_FixWeaponOrder_BuildImpulseList_order = string_null;
176 return substring(o, 1, -1);
179 string W_FixWeaponOrder_AllowIncomplete(entity this, string order)
181 return W_FixWeaponOrder(order, 0);
184 string W_FixWeaponOrder_ForceComplete(string order)
186 if (order == "") order = W_NumberWeaponOrder(cvar_defstring("cl_weaponpriority"));
187 return W_FixWeaponOrder(order, 1);
190 WepSet W_RandomWeapons(entity e, WepSet remaining, int n)
192 WepSet result = '0 0 0';
193 for (int j = 0; j < n; ++j)
195 RandomSelection_Init();
196 FOREACH(Weapons, it != WEP_Null, {
197 if (remaining & (it.m_wepset))
198 RandomSelection_AddEnt(it, 1, 1);
200 Weapon w = RandomSelection_chosen_ent;
201 result |= WepSet_FromWeapon(w);
202 remaining &= ~WepSet_FromWeapon(w);
207 string GetAmmoPicture(int ammotype)
211 case RES_SHELLS: return ITEM_Shells.m_icon;
212 case RES_BULLETS: return ITEM_Bullets.m_icon;
213 case RES_ROCKETS: return ITEM_Rockets.m_icon;
214 case RES_CELLS: return ITEM_Cells.m_icon;
215 case RES_PLASMA: return ITEM_Plasma.m_icon;
216 case RES_FUEL: return ITEM_JetpackFuel.m_icon;
217 default: return ""; // wtf, no ammo type?
221 string GetAmmoName(int ammotype)
225 case RES_SHELLS: return ITEM_Shells.m_name;
226 case RES_BULLETS: return ITEM_Bullets.m_name;
227 case RES_ROCKETS: return ITEM_Rockets.m_name;
228 case RES_CELLS: return ITEM_Cells.m_name;
229 case RES_PLASMA: return ITEM_Plasma.m_name;
230 case RES_FUEL: return ITEM_JetpackFuel.m_name;
231 default: return "batteries";
235 entity GetAmmoItem(int ammotype)
239 case RES_SHELLS: return ITEM_Shells;
240 case RES_BULLETS: return ITEM_Bullets;
241 case RES_ROCKETS: return ITEM_Rockets;
242 case RES_CELLS: return ITEM_Cells;
243 case RES_PLASMA: return ITEM_Plasma;
244 case RES_FUEL: return ITEM_JetpackFuel;
246 LOG_WARNF("Invalid ammo type %d ", ammotype);
248 // WEAPONTODO: use this generic func to reduce duplication ?
249 // GetAmmoPicture GetAmmoName notif_arg_item_wepammo ammo_pickupevalfunc ?
253 int GetAmmoTypeFromNum(int i)
257 case 0: return RES_SHELLS;
258 case 1: return RES_BULLETS;
259 case 2: return RES_ROCKETS;
260 case 3: return RES_CELLS;
261 case 4: return RES_PLASMA;
262 case 5: return RES_FUEL;
263 default: return RES_NONE;
267 int GetAmmoStat(int ammotype)
271 case RES_SHELLS: return STAT_SHELLS;
272 case RES_BULLETS: return STAT_NAILS;
273 case RES_ROCKETS: return STAT_ROCKETS;
274 case RES_CELLS: return STAT_CELLS;
275 case RES_PLASMA: return STAT_PLASMA.m_id;
276 case RES_FUEL: return STAT_FUEL.m_id;
282 string W_Sound(string w_snd)
284 string output = strcat("weapons/", w_snd);
285 MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
286 return M_ARGV(1, string);
289 string W_Model(string w_mdl)
291 string output = strcat("models/weapons/", w_mdl);
292 MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
293 return M_ARGV(1, string);
297 vector shotorg_adjustfromclient(vector vecs, float y_is_right, float algn)
319 vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn)
324 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
326 else if (STAT(SHOOTFROMEYE))
330 else if (STAT(SHOOTFROMCENTER))
335 else if ((s = G_SHOOTFROMFIXEDORIGIN) != "")
338 if (y_is_right) v.y = -v.y;
339 if (v.x != 0) vecs.x = v.x;
343 else // just do the same as top
345 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
351 #define shotorg_adjust shotorg_adjust_values
356 * 1. simple animated model, muzzle flash handling on h_ model:
357 * h_tuba.dpm, h_tuba.dpm.framegroups - invisible model controlling the animation
359 * shot = muzzle end (shot origin, also used for muzzle flashes)
360 * shell = casings ejection point (must be on the right hand side of the gun)
361 * weapon = attachment for v_tuba.md3
362 * v_tuba.md3 - first and third person model
363 * g_tuba.md3 - pickup model
365 * 2. simple animated model, muzzle flash handling on v_ model:
366 * h_tuba.dpm, h_tuba.dpm.framegroups - invisible model controlling the animation
368 * weapon = attachment for v_tuba.md3
369 * v_tuba.md3 - first and third person model
371 * shot = muzzle end (shot origin, also used for muzzle flashes)
372 * shell = casings ejection point (must be on the right hand side of the gun)
373 * g_tuba.md3 - pickup model
375 * 3. fully animated model, muzzle flash handling on h_ model:
376 * h_tuba.dpm, h_tuba.dpm.framegroups - animated first person model
378 * shot = muzzle end (shot origin, also used for muzzle flashes)
379 * shell = casings ejection point (must be on the right hand side of the gun)
380 * handle = corresponding to the origin of v_tuba.md3 (used for muzzle flashes)
381 * v_tuba.md3 - third person model
382 * g_tuba.md3 - pickup model
384 * 4. fully animated model, muzzle flash handling on v_ model:
385 * h_tuba.dpm, h_tuba.dpm.framegroups - animated first person model
387 * shot = muzzle end (shot origin)
388 * shell = casings ejection point (must be on the right hand side of the gun)
389 * v_tuba.md3 - third person model
391 * shot = muzzle end (for muzzle flashes)
392 * g_tuba.md3 - pickup model
395 * this.origin, this.angles
397 * this.movedir, this.view_ofs, this.movedir_aligned
404 void CL_WeaponEntity_SetModel(entity this, string name, bool _anim)
408 vector oldmin = this.mins, oldmax = this.maxs;
409 setmodel(this, MDL_Null);
410 setsize(this, oldmin, oldmax);
411 if (this.weaponchild) delete(this.weaponchild);
412 this.weaponchild = NULL;
413 this.movedir = '0 0 0';
414 this.spawnorigin = '0 0 0';
415 this.oldorigin = '0 0 0';
416 this.anim_fire1 = '0 1 0.01';
417 this.anim_fire2 = '0 1 0.01';
418 this.anim_idle = '0 1 0.01';
419 this.anim_reload = '0 1 0.01';
423 // if there is a child entity, hide it until we're sure we use it
424 if (this.weaponchild) this.weaponchild.model = "";
425 _setmodel(this, W_Model(strcat("v_", name, ".md3")));
426 int v_shot_idx; // used later
427 (v_shot_idx = gettagindex(this, "shot")) || (v_shot_idx = gettagindex(this, "tag_shot"));
429 _setmodel(this, W_Model(strcat("h_", name, ".iqm")));
430 // preset some defaults that work great for renamed zym files (which don't need an animinfo)
431 this.anim_fire1 = animfixfps(this, '0 1 0.01', '0 0 0');
432 this.anim_fire2 = animfixfps(this, '1 1 0.01', '0 0 0');
433 this.anim_idle = animfixfps(this, '2 1 0.01', '0 0 0');
434 this.anim_reload = animfixfps(this, '3 1 0.01', '0 0 0');
436 // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)
437 // if we don't, this is a "real" animated model
439 if ((t = "weapon", gettagindex(this, t)) || (t = "tag_weapon", gettagindex(this, t)))
441 if (!this.weaponchild)
443 this.weaponchild = new(weaponchild);
445 this.weaponchild.drawmask = MASK_NORMAL;
446 this.weaponchild.renderflags |= RF_VIEWMODEL;
449 _setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
450 setsize(this.weaponchild, '0 0 0', '0 0 0');
451 setattachment(this.weaponchild, this, t);
455 if (this.weaponchild) delete(this.weaponchild);
456 this.weaponchild = NULL;
459 setsize(this, '0 0 0', '0 0 0');
460 setorigin(this, '0 0 0');
461 this.angles = '0 0 0';
464 this.viewmodelforclient = NULL;
466 this.renderflags &= ~RF_VIEWMODEL;
468 if (v_shot_idx) // v_ model attached to invisible h_ model
470 this.movedir = gettaginfo(this.weaponchild, v_shot_idx);
475 if ((idx = gettagindex(this, "shot")) || (idx = gettagindex(this, "tag_shot")))
477 this.movedir = gettaginfo(this, idx);
481 LOG_WARNF("weapon model %s does not support the 'shot' tag, will display shots TOTALLY wrong",
483 this.movedir = '0 0 0';
488 // v_ model attached to invisible h_ model
490 && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
492 this.spawnorigin = gettaginfo(this.weaponchild, idx);
494 else if ((idx = gettagindex(this, "shell")) || (idx = gettagindex(this, "tag_shell")))
496 this.spawnorigin = gettaginfo(this, idx);
500 LOG_WARNF("weapon model %s does not support the 'shell' tag, will display casings wrong",
502 this.spawnorigin = this.movedir;
507 this.oldorigin = '0 0 0'; // use regular attachment
512 if (this.weaponchild)
513 (idx = gettagindex(this, "weapon")) || (idx = gettagindex(this, "tag_weapon"));
515 (idx = gettagindex(this, "handle")) || (idx = gettagindex(this, "tag_handle"));
518 this.oldorigin = this.movedir - gettaginfo(this, idx);
523 "weapon model %s does not support the 'handle' tag "
524 "and neither does the v_ model support the 'shot' tag, "
525 "will display muzzle flashes TOTALLY wrong\n",
527 this.oldorigin = '0 0 0'; // there is no way to recover from this
532 this.viewmodelforclient = this.owner;
534 this.renderflags |= RF_VIEWMODEL;
538 this.view_ofs = '0 0 0';
539 this.movedir_aligned = this.movedir;
541 if (this.movedir.x >= 0)
543 //int algn = STAT(GUNALIGN, this.owner);
544 int algn = W_GunAlign(this, STAT(GUNALIGN, this.owner));
546 this.m_gunalign = algn;
548 vector v = this.movedir;
549 this.movedir = shotorg_adjust(v, false, false, algn);
550 this.movedir_aligned = shotorg_adjust(v, false, true, algn);
551 this.view_ofs = shotorg_adjust(v, false, true, algn) - v;
553 int compressed_shotorg = compressShotOrigin(this.movedir);
554 // make them match perfectly
557 if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
559 this.movedir = decompressShotOrigin(compressed_shotorg);
561 this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
563 // check if an instant weapon switch occurred
564 setorigin(this, this.view_ofs);
566 // reset animstate now
567 this.wframe = WFRAME_IDLE;
568 setanim(this, this.anim_idle, true, false, true);
574 REGISTER_NET_TEMP(wframe)
576 NET_HANDLE(wframe, bool isNew)
578 WFRAME fr = ReadByte();
579 float t = ReadFloat();
580 int slot = ReadByte();
581 bool restartanim = ReadByte();
582 entity wepent = viewmodels[slot];
583 if(fr == WFRAME_IDLE)
584 wepent.animstate_looping = false; // we don't need to enforce idle animation
591 case WFRAME_IDLE: a = wepent.anim_idle; break;
592 case WFRAME_FIRE1: a = wepent.anim_fire1; break;
593 case WFRAME_FIRE2: a = wepent.anim_fire2; break;
594 case WFRAME_RELOAD: a = wepent.anim_reload; break;
597 anim_set(wepent, a, !restartanim, restartanim, restartanim);
599 wepent.state = ReadByte();
600 wepent.weapon_nextthink = ReadFloat();
601 switch (wepent.state)
604 wepent.weapon_switchdelay = wepent.activeweapon.switchdelay_raise;
607 wepent.weapon_switchdelay = wepent.activeweapon.switchdelay_drop;
610 wepent.weapon_switchdelay = 0;
618 void wframe_send(entity actor, entity weaponentity, int wepframe, float attackrate, bool restartanim)
620 if (!IS_REAL_CLIENT(actor)) return;
621 int channel = MSG_ONE;
623 WriteHeader(channel, wframe);
624 WriteByte(channel, wepframe);
625 WriteFloat(channel, attackrate);
626 WriteByte(channel, weaponslot(weaponentity.weaponentity_fld));
627 WriteByte(channel, restartanim);
628 WriteByte(channel, weaponentity.state);
629 WriteFloat(channel, weaponentity.weapon_nextthink);
633 REGISTER_NET_C2S(w_whereis)
635 void Weapon_whereis(Weapon this, entity cl);
636 NET_HANDLE(w_whereis, bool)
638 Weapon wpn = ReadRegistered(Weapons);
639 if (wpn != WEP_Null) Weapon_whereis(wpn, sender);
643 void w_whereis(Weapon this)
645 int channel = MSG_C2S;
646 WriteHeader(channel, w_whereis);
647 WriteRegistered(Weapons, channel, this);
649 CLIENT_COMMAND(weapon_find, "Show spawn locations of a weapon")
653 case CMD_REQUEST_COMMAND:
658 FOREACH(Weapons, it != WEP_Null, w_whereis(it));
663 FOREACH(Weapons, it != WEP_Null && !(STAT(WEAPONS) & it.m_wepset), w_whereis(it));
666 FOREACH(Weapons, it != WEP_Null && it.netname == s,
673 LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
674 case CMD_REQUEST_USAGE:
676 LOG_HELP("Usage:^3 cl_cmd weapon_find weapon");
677 LOG_HELP(" Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.");
685 void W_MuzzleFlash_Model_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector offset)
688 flash.angles_z = random() * 360;
690 entity view = actor.(weaponentity);
691 entity exterior = actor.exteriorweaponentity;
693 if (view.oldorigin.x > 0)
695 setattachment(flash, exterior, "");
696 setorigin(flash, view.oldorigin + offset);
700 if (gettagindex(exterior, "shot")) setattachment(flash, exterior, "shot");
701 else setattachment(flash, exterior, "tag_shot");
702 setorigin(flash, offset);
706 void W_MuzzleFlash_Model_AttachToShotorg(entity wepent, entity flash, vector offset)
708 flash.owner = wepent;
709 flash.angles_z = random() * 360;
711 if (gettagindex(wepent, "shot")) setattachment(flash, wepent, "shot");
712 else setattachment(flash, wepent, "tag_shot");
713 setorigin(flash, offset);
717 void W_MuzzleFlash_Model_Think(entity this)
722 this.nextthink = time + 0.05;
726 setthink(this, SUB_Remove);
727 this.nextthink = time;
728 this.realowner.muzzle_flash = NULL;
733 void W_MuzzleFlash_Model(entity wepent, entity muzzlemodel)
735 if(wepent.muzzle_flash == NULL)
736 wepent.muzzle_flash = spawn();
738 entity flash = wepent.muzzle_flash;
739 setmodel(flash, muzzlemodel); // precision set below
742 setthink(flash, W_MuzzleFlash_Model_Think);
743 flash.nextthink = time + 0.02;
746 flash.angles_z = random() * 180;
747 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT;
748 flash.owner = flash.realowner = wepent;
751 flash.drawmask = MASK_NORMAL;
755 REGISTER_NET_TEMP(w_muzzleflash)
758 void W_MuzzleFlash(Weapon thiswep, entity actor, .entity weaponentity, vector shotorg, vector shotdir)
760 // don't show an exterior muzzle effect for the off-hand
761 if(weaponslot(weaponentity) == 0)
763 Send_Effect_Except(thiswep.m_muzzleeffect, shotorg, shotdir * 1000, 1, actor);
765 if(thiswep.m_muzzlemodel != MDL_Null)
767 W_MuzzleFlash_Model(actor.exteriorweaponentity, thiswep.m_muzzlemodel);
768 W_MuzzleFlash_Model_AttachToShotorg(actor, weaponentity, actor.exteriorweaponentity.muzzle_flash, '5 0 0');
772 FOREACH_CLIENT(it == actor || (IS_SPEC(it) && it.enemy == actor),
774 if(!IS_REAL_CLIENT(it))
776 int channel = MSG_ONE;
778 WriteHeader(channel, w_muzzleflash);
779 WriteByte(channel, thiswep.m_id);
780 WriteByte(channel, weaponslot(weaponentity));
781 WriteVector(channel, shotorg);
785 NET_HANDLE(w_muzzleflash, bool isNew)
788 int weapon_id = ReadByte();
789 int slot = ReadByte();
790 vector sv_shotorg = ReadVector();
792 Weapon thiswep = REGISTRY_GET(Weapons, weapon_id);
793 vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
794 vector forward, right, up;
795 MAKE_VECTORS(viewangles, forward, right, up);
797 if(autocvar_chase_active)
799 // in third person mode, show the muzzle flash from the server side weapon position
800 // we don't have a view model to reference in this case
801 pointparticles(thiswep.m_muzzleeffect, sv_shotorg, forward * 1000, 1);
804 if(!autocvar_r_drawviewmodel) return;
806 entity wepent = viewmodels[slot];
807 // get the local player entity to calculate shot origin
808 entity rlplayer = CSQCModel_server2csqc(player_localentnum - 1);
810 rlplayer = csqcplayer; // fall back to the global
812 vector md = wepent.movedir_aligned;
813 vector vecs = ((md.x > 0) ? md : '0 0 0');
814 vector dv = forward * vecs.x + right * -vecs.y + up * vecs.z;
815 vector org = rlplayer.origin + rlplayer.view_ofs + dv;
817 pointparticles(thiswep.m_muzzleeffect, org, forward * 1000, 1);
819 if(thiswep.m_muzzlemodel != MDL_Null)
821 W_MuzzleFlash_Model(wepent, thiswep.m_muzzlemodel);
822 W_MuzzleFlash_Model_AttachToShotorg(wepent, wepent.muzzle_flash, '5 0 0');