From: Mario Date: Sat, 18 Jul 2020 16:54:41 +0000 (+1000) Subject: Attach muzzle effects to weapon data instead of trying to send it for each muzzle... X-Git-Tag: xonotic-v0.8.5~848 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=428da72281f326b423fbd2649f138bb24ca8fa0b;p=xonotic%2Fxonotic-data.pk3dir.git Attach muzzle effects to weapon data instead of trying to send it for each muzzle flash, reduces bandwidth consumption of CSQC muzzle flashes and fixes potential for mismatching muzzle flash models --- diff --git a/qcsrc/common/mutators/mutator/overkill/okhmg.qc b/qcsrc/common/mutators/mutator/overkill/okhmg.qc index 7007f0866..51b3c05d9 100644 --- a/qcsrc/common/mutators/mutator/overkill/okhmg.qc +++ b/qcsrc/common/mutators/mutator/overkill/okhmg.qc @@ -40,7 +40,7 @@ void W_OverkillHeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1; - W_MuzzleFlash(actor, weaponentity, EFFECT_MACHINEGUN_MUZZLEFLASH, MDL_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); if (autocvar_g_casings >= 2) // casing code { diff --git a/qcsrc/common/mutators/mutator/overkill/okhmg.qh b/qcsrc/common/mutators/mutator/overkill/okhmg.qh index 77204ae1a..8a00b4d77 100644 --- a/qcsrc/common/mutators/mutator/overkill/okhmg.qh +++ b/qcsrc/common/mutators/mutator/overkill/okhmg.qh @@ -12,6 +12,8 @@ CLASS(OverkillHeavyMachineGun, Weapon) /* modelname */ ATTRIB(OverkillHeavyMachineGun, mdl, string, "ok_hmg"); #ifdef GAMEQC /* model */ ATTRIB(OverkillHeavyMachineGun, m_model, Model, MDL_HMG_ITEM); +/* flash mdl */ ATTRIB(OverkillHeavyMachineGun, m_muzzlemodel, Model, MDL_MACHINEGUN_MUZZLEFLASH); +/* flash eff */ ATTRIB(OverkillHeavyMachineGun, m_muzzleeffect, entity, EFFECT_MACHINEGUN_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(OverkillHeavyMachineGun, w_crosshair, string, "gfx/crosshairuzi"); /* crosshair */ ATTRIB(OverkillHeavyMachineGun, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc index dbc7f656a..b64af05f7 100644 --- a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc @@ -34,7 +34,7 @@ void W_OverkillMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weap actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1; - W_MuzzleFlash(actor, weaponentity, EFFECT_MACHINEGUN_MUZZLEFLASH, MDL_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); if(autocvar_g_casings >= 2) // casing code { diff --git a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh index 77082c962..10f3b9c09 100644 --- a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh +++ b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh @@ -10,6 +10,8 @@ CLASS(OverkillMachineGun, Weapon) /* modelname */ ATTRIB(OverkillMachineGun, mdl, string, "ok_mg"); #ifdef GAMEQC /* model */ ATTRIB(OverkillMachineGun, m_model, Model, MDL_OK_MG_ITEM); +/* flash mdl */ ATTRIB(OverkillMachineGun, m_muzzlemodel, Model, MDL_MACHINEGUN_MUZZLEFLASH); +/* flash eff */ ATTRIB(OverkillMachineGun, m_muzzleeffect, entity, EFFECT_MACHINEGUN_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(OverkillMachineGun, w_crosshair, string, "gfx/crosshairuzi"); /* crosshair */ ATTRIB(OverkillMachineGun, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qc b/qcsrc/common/mutators/mutator/overkill/okrpc.qc index ea3c63b02..25704934f 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qc @@ -90,7 +90,7 @@ void W_OverkillRocketPropelledChainsaw_Attack(Weapon thiswep, entity actor, .ent W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(okrpc, ammo), weaponentity); W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(okrpc, damage), thiswep.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_ROCKET_MUZZLEFLASH, MDL_RPC_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); PROJECTILE_MAKETRIGGER(missile); missile.owner = missile.realowner = actor; diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qh b/qcsrc/common/mutators/mutator/overkill/okrpc.qh index 928bfc0b9..6b6763ce7 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qh +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qh @@ -12,6 +12,8 @@ CLASS(OverkillRocketPropelledChainsaw, Weapon) /* modelname */ ATTRIB(OverkillRocketPropelledChainsaw, mdl, string, "ok_rl"); #ifdef GAMEQC /* model */ ATTRIB(OverkillRocketPropelledChainsaw, m_model, Model, MDL_RPC_ITEM); +/* flash mdl */ ATTRIB(OverkillRocketPropelledChainsaw, m_muzzlemodel, Model, MDL_RPC_MUZZLEFLASH); +/* flash eff */ ATTRIB(OverkillRocketPropelledChainsaw, m_muzzleeffect, entity, EFFECT_ROCKET_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(OverkillRocketPropelledChainsaw, w_crosshair, string, "gfx/crosshairrocketlauncher"); /* crosshair */ ATTRIB(OverkillRocketPropelledChainsaw, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index ad0e0cae3..9feb5ffe4 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -747,16 +747,16 @@ void W_MuzzleFlash_Model(entity wepent, entity muzzlemodel) REGISTER_NET_TEMP(w_muzzleflash) #ifdef SVQC -void W_MuzzleFlash(entity actor, .entity weaponentity, entity eff, entity muzzlemodel, vector shotorg, vector shotdir) +void W_MuzzleFlash(Weapon thiswep, entity actor, .entity weaponentity, vector shotorg, vector shotdir) { // don't show an exterior muzzle effect for the off-hand if(weaponslot(weaponentity) == 0) { - Send_Effect_Except(eff, shotorg, shotdir * 1000, 1, actor); + Send_Effect_Except(thiswep.m_muzzleeffect, shotorg, shotdir * 1000, 1, actor); - if(muzzlemodel != MDL_Null) + if(thiswep.m_muzzlemodel != MDL_Null) { - W_MuzzleFlash_Model(actor.exteriorweaponentity, muzzlemodel); + W_MuzzleFlash_Model(actor.exteriorweaponentity, thiswep.m_muzzlemodel); W_MuzzleFlash_Model_AttachToShotorg(actor, weaponentity, actor.exteriorweaponentity.muzzle_flash, '5 0 0'); } } @@ -768,13 +768,8 @@ void W_MuzzleFlash(entity actor, .entity weaponentity, entity eff, entity muzzle int channel = MSG_ONE; msg_entity = it; WriteHeader(channel, w_muzzleflash); + WriteByte(channel, thiswep.m_id); WriteByte(channel, weaponslot(weaponentity)); - (Effects_COUNT >= 255) - ? WriteShort(channel, eff.m_id) - : WriteByte(channel, eff.m_id); - (Models_COUNT >= 255) - ? WriteShort(channel, muzzlemodel.m_id) - : WriteByte(channel, muzzlemodel.m_id); WriteVector(channel, shotorg); }); } @@ -782,12 +777,11 @@ void W_MuzzleFlash(entity actor, .entity weaponentity, entity eff, entity muzzle NET_HANDLE(w_muzzleflash, bool isNew) { return = true; + int weapon_id = ReadByte(); int slot = ReadByte(); - int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte(); - int net_modelname = (Models_COUNT >= 255) ? ReadShort() : ReadByte(); vector sv_shotorg = ReadVector(); - entity eff = Effects_from(net_name); + Weapon thiswep = REGISTRY_GET(Weapons, weapon_id); vector viewangles = getpropertyvec(VF_CL_VIEWANGLES); vector forward, right, up; MAKE_VECTORS(viewangles, forward, right, up); @@ -796,12 +790,11 @@ NET_HANDLE(w_muzzleflash, bool isNew) { // in third person mode, show the muzzle flash from the server side weapon position // we don't have a view model to reference in this case - pointparticles(eff, sv_shotorg, forward * 1000, 1); + pointparticles(thiswep.m_muzzleeffect, sv_shotorg, forward * 1000, 1); return; } if(!autocvar_r_drawviewmodel) return; - entity muzzlemodel = Models_from(net_modelname); entity wepent = viewmodels[slot]; // get the local player entity to calculate shot origin entity rlplayer = CSQCModel_server2csqc(player_localentnum - 1); @@ -815,11 +808,11 @@ NET_HANDLE(w_muzzleflash, bool isNew) tracebox(org, '0 0 0', '0 0 0', org + forward * (vecs.x + 1), MOVE_NORMAL, rlplayer); org = trace_endpos - forward * 1; - pointparticles(eff, org, forward * 1000, 1); + pointparticles(thiswep.m_muzzleeffect, org, forward * 1000, 1); - if(muzzlemodel != MDL_Null) + if(thiswep.m_muzzlemodel != MDL_Null) { - W_MuzzleFlash_Model(wepent, muzzlemodel); + W_MuzzleFlash_Model(wepent, thiswep.m_muzzlemodel); W_MuzzleFlash_Model_AttachToShotorg(wepent, wepent.muzzle_flash, '5 0 0'); } } diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 776861d7e..f98152aa8 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -20,6 +20,7 @@ WepSet ReadWepSet(); #include "calculations.qh" #include "projectiles.qh" #include +#include #endif #include @@ -401,6 +402,6 @@ void wframe_send(entity actor, entity weaponentity, int wepframe, float attackra #endif #ifdef SVQC -void W_MuzzleFlash(entity actor, .entity weaponentity, entity eff, entity muzzlemodel, vector shotorg, vector shotdir); +void W_MuzzleFlash(Weapon thiswep, entity actor, .entity weaponentity, vector shotorg, vector shotdir); #endif #endif diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 2d176c04e..67f646cbe 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -56,8 +56,14 @@ CLASS(Weapon, Object) ATTRIB(Weapon, wpcolor, vector, '0 0 0'); /** M: modelname : name of model (without g_ v_ or h_ prefixes) */ ATTRIB(Weapon, mdl, string, ""); +#ifdef GAMEQC /** M: model MDL_id_ITEM */ ATTRIB(Weapon, m_model, entity); + /** M: flash model MDL_id_MUZZLEFLASH */ + ATTRIB(Weapon, m_muzzlemodel, entity, MDL_Null); + /** M: flash effect EFFECT_id_MUZZLEFLASH */ + ATTRIB(Weapon, m_muzzleeffect, entity); +#endif /** M: crosshair : per-weapon crosshair: "CrosshairImage Size" */ ATTRIB(Weapon, w_crosshair, string, "gfx/crosshairmoustache"); /** A: crosshair : per-weapon crosshair size (argument two of "crosshair" field) */ diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index a16d7af3e..387bb910f 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -131,7 +131,7 @@ void W_Arc_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot(actor, weaponentity, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage), WEP_ARC.m_id | HITTYPE_SECONDARY); - W_MuzzleFlash(actor, weaponentity, EFFECT_ARC_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); missile = new(missile); missile.owner = missile.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/arc.qh b/qcsrc/common/weapons/weapon/arc.qh index 13321039c..3c79dc335 100644 --- a/qcsrc/common/weapons/weapon/arc.qh +++ b/qcsrc/common/weapons/weapon/arc.qh @@ -10,6 +10,8 @@ CLASS(Arc, Weapon) /* modelname */ ATTRIB(Arc, mdl, string, "arc"); #ifdef GAMEQC /* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM); +/* flash mdl */ ATTRIB(Arc, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Arc, m_muzzleeffect, entity, EFFECT_ARC_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac"); /* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7); diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index cf812f458..e0fd2282b 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -55,7 +55,7 @@ void W_Blaster_Attack( vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD); W_SetupShot_Dir(actor, weaponentity, s_forward, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, atk_damage, atk_deathtype); - W_MuzzleFlash(actor, weaponentity, EFFECT_BLASTER_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(WEP_BLASTER, actor, weaponentity, w_shotorg, w_shotdir); entity missile = new(blasterbolt); missile.owner = missile.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/blaster.qh b/qcsrc/common/weapons/weapon/blaster.qh index 87824310c..ed966cf2f 100644 --- a/qcsrc/common/weapons/weapon/blaster.qh +++ b/qcsrc/common/weapons/weapon/blaster.qh @@ -10,6 +10,8 @@ CLASS(Blaster, Weapon) /* modelname */ ATTRIB(Blaster, mdl, string, "laser"); #ifdef GAMEQC /* model */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM); +/* flash mdl */ ATTRIB(Blaster, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Blaster, m_muzzleeffect, entity, EFFECT_BLASTER_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser"); /* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index df26fdfdc..abed4209f 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -307,7 +307,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity) up = v_up; shots = WEP_CVAR_PRI(crylink, shots); - W_MuzzleFlash(actor, weaponentity, EFFECT_CRYLINK_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { @@ -420,7 +420,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) up = v_up; shots = WEP_CVAR_SEC(crylink, shots); - W_MuzzleFlash(actor, weaponentity, EFFECT_CRYLINK_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { diff --git a/qcsrc/common/weapons/weapon/crylink.qh b/qcsrc/common/weapons/weapon/crylink.qh index 5843c94bb..501b87822 100644 --- a/qcsrc/common/weapons/weapon/crylink.qh +++ b/qcsrc/common/weapons/weapon/crylink.qh @@ -10,6 +10,8 @@ CLASS(Crylink, Weapon) /* modelname */ ATTRIB(Crylink, mdl, string, "crylink"); #ifdef GAMEQC /* model */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM); +/* flash mdl */ ATTRIB(Crylink, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Crylink, m_muzzleeffect, entity, EFFECT_CRYLINK_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink"); /* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index f67b5868c..891c44583 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -308,7 +308,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo), weaponentity); W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage), thiswep.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_ROCKET_MUZZLEFLASH, MDL_DEVASTATOR_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); entity missile = WarpZone_RefSys_SpawnSameRefSys(actor); missile.weaponentity_fld = weaponentity; diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 679f75499..11481c6f9 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -10,6 +10,8 @@ CLASS(Devastator, Weapon) /* modelname */ ATTRIB(Devastator, mdl, string, "rl"); #ifdef GAMEQC /* model */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM); +/* flash mdl */ ATTRIB(Devastator, m_muzzlemodel, Model, MDL_DEVASTATOR_MUZZLEFLASH); +/* flash eff */ ATTRIB(Devastator, m_muzzleeffect, entity, EFFECT_ROCKET_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher"); /* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7); diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 61acc0dd7..10005f22e 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -227,7 +227,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity) thiswep.m_id ); - W_MuzzleFlash(actor, weaponentity, EFFECT_ELECTRO_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); proj = new(electro_bolt); proj.owner = proj.realowner = actor; @@ -378,7 +378,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity) w_shotdir = v_forward; // no TrueAim for grenades please - W_MuzzleFlash(actor, weaponentity, EFFECT_ELECTRO_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); entity proj = new(electro_orb); proj.owner = proj.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 448081220..9583bc9f2 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -10,6 +10,8 @@ CLASS(Electro, Weapon) /* modelname */ ATTRIB(Electro, mdl, string, "electro"); #ifdef GAMEQC /* model */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM); +/* flash mdl */ ATTRIB(Electro, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Electro, m_muzzleeffect, entity, EFFECT_ELECTRO_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro"); /* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 1ecacb5a3..edbdecf0f 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -137,7 +137,7 @@ void W_Fireball_Attack1(entity actor, .entity weaponentity) { W_SetupShot_ProjectileSize(actor, weaponentity, '-16 -16 -16', '16 16 16', false, 2, SND_FIREBALL_FIRE2, CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage), WEP_FIREBALL.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_FIREBALL_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir); entity proj = new(plasma_prim); proj.owner = proj.realowner = actor; @@ -176,7 +176,7 @@ void W_Fireball_AttackEffect(entity actor, .entity weaponentity, float i, vector { W_SetupShot_ProjectileSize(actor, weaponentity, '-16 -16 -16', '16 16 16', false, 0, SND_Null, 0, 0, WEP_FIREBALL.m_id); // TODO: probably doesn't need deathtype, just a prefire effect w_shotorg += f_diff.x * v_up + f_diff.y * v_right; - W_MuzzleFlash(actor, weaponentity, EFFECT_FIREBALL_PRE_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); } void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, .entity weaponentity, int fire) @@ -275,7 +275,7 @@ void W_Fireball_Attack2(entity actor, .entity weaponentity) traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, actor); w_shotorg = trace_endpos; - W_MuzzleFlash(actor, weaponentity, EFFECT_FIREBALL_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir); proj = new(grenade); proj.owner = proj.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/fireball.qh b/qcsrc/common/weapons/weapon/fireball.qh index ba391f6a2..dc59a109c 100644 --- a/qcsrc/common/weapons/weapon/fireball.qh +++ b/qcsrc/common/weapons/weapon/fireball.qh @@ -10,6 +10,8 @@ CLASS(Fireball, Weapon) /* modelname */ ATTRIB(Fireball, mdl, string, "fireball"); #ifdef GAMEQC /* model */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM); +/* flash mdl */ ATTRIB(Fireball, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Fireball, m_muzzleeffect, entity, EFFECT_FIREBALL_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball"); /* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65); diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 04989d7aa..73cb2b8b9 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -83,7 +83,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage), thiswep.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_HAGAR_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); missile = new(missile); missile.owner = missile.realowner = actor; @@ -129,7 +129,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage), thiswep.m_id | HITTYPE_SECONDARY); - W_MuzzleFlash(actor, weaponentity, EFFECT_HAGAR_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); missile = new(missile); missile.owner = missile.realowner = actor; @@ -185,7 +185,7 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen shots = actor.(weaponentity).hagar_load; W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage) * shots, thiswep.m_id | HITTYPE_SECONDARY); - W_MuzzleFlash(actor, weaponentity, EFFECT_HAGAR_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); forward = v_forward; right = v_right; diff --git a/qcsrc/common/weapons/weapon/hagar.qh b/qcsrc/common/weapons/weapon/hagar.qh index 0d0f11e85..d9df8485f 100644 --- a/qcsrc/common/weapons/weapon/hagar.qh +++ b/qcsrc/common/weapons/weapon/hagar.qh @@ -10,6 +10,8 @@ CLASS(Hagar, Weapon) /* modelname */ ATTRIB(Hagar, mdl, string, "hagar"); #ifdef GAMEQC /* model */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM); +/* flash mdl */ ATTRIB(Hagar, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Hagar, m_muzzleeffect, entity, EFFECT_HAGAR_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar"); /* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8); diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 34481e619..da2660b89 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -31,7 +31,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity) spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod); W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage), thiswep.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_BLASTER_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); if(!autocvar_g_norecoil) { actor.punchangle_x = random() - 0.5; @@ -81,7 +81,7 @@ void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity) spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod); W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage), thiswep.m_id | HITTYPE_SECONDARY); - W_MuzzleFlash(actor, weaponentity, EFFECT_BLASTER_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); missile = new(hlacbolt); missile.owner = missile.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/hlac.qh b/qcsrc/common/weapons/weapon/hlac.qh index 769209259..5ff0e2b30 100644 --- a/qcsrc/common/weapons/weapon/hlac.qh +++ b/qcsrc/common/weapons/weapon/hlac.qh @@ -10,6 +10,8 @@ CLASS(HLAC, Weapon) /* modelname */ ATTRIB(HLAC, mdl, string, "hlac"); #ifdef GAMEQC /* model */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM); +/* flash mdl */ ATTRIB(HLAC, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(HLAC, m_muzzleeffect, entity, EFFECT_BLASTER_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(HLAC, w_crosshair, string, "gfx/crosshairhlac"); /* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/weapon/hook.qh b/qcsrc/common/weapons/weapon/hook.qh index bff975e00..385fab4d6 100644 --- a/qcsrc/common/weapons/weapon/hook.qh +++ b/qcsrc/common/weapons/weapon/hook.qh @@ -10,6 +10,8 @@ CLASS(Hook, Weapon) /* modelname */ ATTRIB(Hook, mdl, string, "hookgun"); #ifdef GAMEQC /* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM); +/* flash mdl */ ATTRIB(Hook, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Hook, m_muzzleeffect, entity, EFFECT_HOOK_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook"); /* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5); diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 3b239e7c5..77c99d16d 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -18,7 +18,7 @@ void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity we else fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, EFFECT_BULLET); - W_MuzzleFlash(actor, weaponentity, EFFECT_MACHINEGUN_MUZZLEFLASH, MDL_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); // casing code if(autocvar_g_casings >= 2) @@ -91,7 +91,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1; - W_MuzzleFlash(actor, weaponentity, EFFECT_MACHINEGUN_MUZZLEFLASH, MDL_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); if(autocvar_g_casings >= 2) // casing code { @@ -114,7 +114,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), thiswep.m_id, EFFECT_BULLET); - W_MuzzleFlash(actor, weaponentity, EFFECT_MACHINEGUN_MUZZLEFLASH, MDL_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); if(autocvar_g_casings >= 2) // casing code { diff --git a/qcsrc/common/weapons/weapon/machinegun.qh b/qcsrc/common/weapons/weapon/machinegun.qh index 19bba63a2..acf1668d7 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qh +++ b/qcsrc/common/weapons/weapon/machinegun.qh @@ -10,6 +10,8 @@ CLASS(MachineGun, Weapon) /* modelname */ ATTRIB(MachineGun, mdl, string, "uzi"); #ifdef GAMEQC /* model */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM); +/* flash mdl */ ATTRIB(MachineGun, m_muzzlemodel, Model, MDL_MACHINEGUN_MUZZLEFLASH); +/* flash eff */ ATTRIB(MachineGun, m_muzzleeffect, entity, EFFECT_MACHINEGUN_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi"); /* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index ee512cf32..b458e2c37 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -270,7 +270,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity) W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo), weaponentity); W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_ROCKET_MUZZLEFLASH, MDL_MINELAYER_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); entity mine = WarpZone_RefSys_SpawnSameRefSys(actor); mine.weaponentity_fld = weaponentity; diff --git a/qcsrc/common/weapons/weapon/minelayer.qh b/qcsrc/common/weapons/weapon/minelayer.qh index 6d63e539b..b822eee68 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qh +++ b/qcsrc/common/weapons/weapon/minelayer.qh @@ -10,6 +10,8 @@ CLASS(MineLayer, Weapon) /* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer"); #ifdef GAMEQC /* model */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM); +/* flash mdl */ ATTRIB(MineLayer, m_muzzlemodel, Model, MDL_MINELAYER_MUZZLEFLASH); +/* flash eff */ ATTRIB(MineLayer, m_muzzleeffect, entity, EFFECT_ROCKET_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer"); /* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9); diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 0769fe41a..6f37469f0 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -154,7 +154,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage), thiswep.m_id); w_shotdir = v_forward; // no TrueAim for grenades please - W_MuzzleFlash(actor, weaponentity, EFFECT_GRENADE_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); entity gren = new(grenade); gren.owner = gren.realowner = actor; @@ -206,7 +206,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage), thiswep.m_id | HITTYPE_SECONDARY); w_shotdir = v_forward; // no TrueAim for grenades please - W_MuzzleFlash(actor, weaponentity, EFFECT_GRENADE_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); gren = new(grenade); gren.owner = gren.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/mortar.qh b/qcsrc/common/weapons/weapon/mortar.qh index 459344237..97ee20791 100644 --- a/qcsrc/common/weapons/weapon/mortar.qh +++ b/qcsrc/common/weapons/weapon/mortar.qh @@ -10,6 +10,8 @@ CLASS(Mortar, Weapon) /* modelname */ ATTRIB(Mortar, mdl, string, "gl"); #ifdef GAMEQC /* model */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM); +/* flash mdl */ ATTRIB(Mortar, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Mortar, m_muzzleeffect, entity, EFFECT_GRENADE_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher"); /* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7); diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 9d3e25b3b..456e79c03 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -10,7 +10,7 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo W_SetupShot(actor, weaponentity, true, 2, pSound, CH_WEAPON_A, pDamage * pShots, deathtype); - W_MuzzleFlash(actor, weaponentity, EFFECT_RIFLE_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir * 2); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir * 2); if(PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) // if zoomed, shoot from the eye { diff --git a/qcsrc/common/weapons/weapon/rifle.qh b/qcsrc/common/weapons/weapon/rifle.qh index ae9a3b9aa..679a3fb0c 100644 --- a/qcsrc/common/weapons/weapon/rifle.qh +++ b/qcsrc/common/weapons/weapon/rifle.qh @@ -10,6 +10,8 @@ CLASS(Rifle, Weapon) /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle"); #ifdef GAMEQC /* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM); +/* flash mdl */ ATTRIB(Rifle, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Rifle, m_muzzleeffect, entity, EFFECT_RIFLE_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle"); /* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 389fdef17..c782b4eaf 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -171,7 +171,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v makevectors(actor.v_angle); W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? thiswep.m_id | HITTYPE_SECONDARY : thiswep.m_id)); w_shotorg += f_diff; - W_MuzzleFlash(actor, weaponentity, EFFECT_SEEKER_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); //actor.detornator = false; @@ -269,7 +269,8 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY); w_shotorg += f_diff; - W_MuzzleFlash(actor, weaponentity, EFFECT_HAGAR_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + // uses hagar effects! + W_MuzzleFlash(WEP_HAGAR, actor, weaponentity, w_shotorg, w_shotdir); missile = new(missile); missile.owner = missile.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/seeker.qh b/qcsrc/common/weapons/weapon/seeker.qh index 569093813..3e79ce252 100644 --- a/qcsrc/common/weapons/weapon/seeker.qh +++ b/qcsrc/common/weapons/weapon/seeker.qh @@ -10,6 +10,8 @@ CLASS(Seeker, Weapon) /* modelname */ ATTRIB(Seeker, mdl, string, "seeker"); #ifdef GAMEQC /* model */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM); +/* flash mdl */ ATTRIB(Seeker, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Seeker, m_muzzleeffect, entity, EFFECT_SEEKER_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker"); /* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8); diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 1757eeff4..8928ec21c 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -31,7 +31,7 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float if(lag && bullets > 0) antilag_restore_all(actor); - W_MuzzleFlash(actor, weaponentity, EFFECT_SHOTGUN_MUZZLEFLASH, MDL_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); // casing code if(autocvar_g_casings >= 1) diff --git a/qcsrc/common/weapons/weapon/shotgun.qh b/qcsrc/common/weapons/weapon/shotgun.qh index dc6dae157..1c2d28010 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qh +++ b/qcsrc/common/weapons/weapon/shotgun.qh @@ -10,6 +10,8 @@ CLASS(Shotgun, Weapon) /* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun"); #ifdef GAMEQC /* model */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM); +/* flash mdl */ ATTRIB(Shotgun, m_muzzlemodel, Model, MDL_SHOTGUN_MUZZLEFLASH); +/* flash eff */ ATTRIB(Shotgun, m_muzzleeffect, entity, EFFECT_SHOTGUN_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun"); /* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 8b1e1bfce..918eeb84c 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -127,7 +127,8 @@ void W_Vaporizer_Attack(Weapon thiswep, entity actor, .entity weaponentity) FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, WEP_CVAR_PRI(vaporizer, force), 0, 0, 0, 0, thiswep.m_id); // do this now, as goodhits is disabled below - W_MuzzleFlash(actor, weaponentity, EFFECT_VORTEX_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg)); SendCSQCVaporizerBeamParticle(actor, damage_goodhits); if(yoda && flying) @@ -187,7 +188,8 @@ void W_RocketMinsta_Attack2(entity actor, .entity weaponentity) W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_ELECTRO_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + // uses electro effects + W_MuzzleFlash(WEP_ELECTRO, actor, weaponentity, w_shotorg, w_shotdir); while(counter < total) { @@ -239,7 +241,8 @@ void W_RocketMinsta_Attack3 (entity actor, .entity weaponentity) W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_ELECTRO_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + // uses electro effects + W_MuzzleFlash(WEP_ELECTRO, actor, weaponentity, w_shotorg, w_shotdir); while(counter < total) { diff --git a/qcsrc/common/weapons/weapon/vaporizer.qh b/qcsrc/common/weapons/weapon/vaporizer.qh index f87a800a9..00dbf78ec 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qh +++ b/qcsrc/common/weapons/weapon/vaporizer.qh @@ -10,6 +10,8 @@ CLASS(Vaporizer, Weapon) /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex"); #ifdef GAMEQC /* model */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM); +/* flash mdl */ ATTRIB(Vaporizer, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Vaporizer, m_muzzleeffect, entity, EFFECT_VORTEX_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex"); /* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6); diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index d8afd115d..bf179e374 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -151,8 +151,9 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i actor.vortex_lasthit = damage_goodhits; - //beam and muzzle flash done on client - W_MuzzleFlash(actor, weaponentity, EFFECT_VORTEX_MUZZLEFLASH, MDL_Null, w_shotorg, w_shotdir); + //beam done on client + vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg)); SendCSQCVortexBeamParticle(charge); W_DecreaseAmmo(thiswep, actor, myammo, weaponentity); diff --git a/qcsrc/common/weapons/weapon/vortex.qh b/qcsrc/common/weapons/weapon/vortex.qh index 783e42a8e..a2b0a4b1d 100644 --- a/qcsrc/common/weapons/weapon/vortex.qh +++ b/qcsrc/common/weapons/weapon/vortex.qh @@ -10,6 +10,8 @@ CLASS(Vortex, Weapon) /* modelname */ ATTRIB(Vortex, mdl, string, "nex"); #ifdef GAMEQC /* model */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM); +/* flash mdl */ ATTRIB(Vortex, m_muzzlemodel, Model, MDL_Null); +/* flash eff */ ATTRIB(Vortex, m_muzzleeffect, entity, EFFECT_VORTEX_MUZZLEFLASH); #endif /* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex"); /* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65); diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 48d02d57b..4894b2724 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -364,7 +364,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity) vector oldmovedir = actor.(weaponentity).movedir; actor.(weaponentity).movedir = vs; W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id); - W_MuzzleFlash(actor, weaponentity, EFFECT_HOOK_MUZZLEFLASH, MDL_Null, w_shotorg, '0 0 0'); + W_MuzzleFlash(WEP_HOOK, actor, weaponentity, w_shotorg, '0 0 0'); actor.(weaponentity).movedir = oldmovedir; entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);