Add modelevent_shell sound shader definitions, so mods can set shell eject
sounds.
This commit is contained in:
parent
95739c7a20
commit
cec4872994
|
@ -0,0 +1,9 @@
|
|||
modelevent_shell.eject
|
||||
{
|
||||
sample misc/null.wav
|
||||
}
|
||||
|
||||
modelevent_shell.land
|
||||
{
|
||||
sample misc/null.wav
|
||||
}
|
|
@ -27,6 +27,10 @@ Event_EjectShell(void)
|
|||
static void Event_EjectShell_Death(void) {
|
||||
remove(self);
|
||||
}
|
||||
static void Event_EjectShell_Touch(void) {
|
||||
if (other == world)
|
||||
Sound_Play(self, CHAN_BODY, "modelevent_shell.land");
|
||||
}
|
||||
vector vEndPos;
|
||||
|
||||
if (!pSeat->m_fEjectModel)
|
||||
|
@ -35,6 +39,7 @@ Event_EjectShell(void)
|
|||
|
||||
entity eShell = spawn();
|
||||
eShell.modelindex = pSeat->m_fEjectModel;
|
||||
eShell.solid = SOLID_BBOX;
|
||||
eShell.movetype = MOVETYPE_BOUNCE;
|
||||
eShell.drawmask = MASK_ENGINE;
|
||||
eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0];
|
||||
|
@ -44,6 +49,7 @@ Event_EjectShell(void)
|
|||
eShell.velocity += (v_forward * pSeat->m_vecEjectVel[0]);
|
||||
eShell.velocity += (v_right * pSeat->m_vecEjectVel[1]);
|
||||
eShell.velocity += (v_up * pSeat->m_vecEjectVel[2]);
|
||||
eShell.touch = Event_EjectShell_Touch;
|
||||
|
||||
eShell.avelocity = [0,45,900];
|
||||
eShell.think = Event_EjectShell_Death;
|
||||
|
@ -51,6 +57,7 @@ Event_EjectShell(void)
|
|||
pSeat->m_fEjectModel = 0;
|
||||
setsize(eShell, [0,0,0], [0,0,0]);
|
||||
setorigin(eShell, pSeat->m_vecEjectPos);
|
||||
Sound_Play(eShell, CHAN_BODY, "modelevent_shell.eject");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -41,6 +41,9 @@ View_Init(void)
|
|||
MUZZLE_WEIRD = (int)getmodelindex("sprites/muzzleflash3.spr");
|
||||
SHELL_DEFAULT = (int)getmodelindex("models/shell.mdl");
|
||||
SHELL_SHOTGUN = (int)getmodelindex("models/shotgunshell.mdl");
|
||||
|
||||
Sound_Precache("modelevent_shell.eject");
|
||||
Sound_Precache("modelevent_shell.land");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue