trigger_teleport: if we're running fs_game "dmc", then force a teleportation sound to play.
This commit is contained in:
parent
a8144ce6c1
commit
ed2d73106f
1 changed files with 22 additions and 0 deletions
|
@ -39,12 +39,30 @@ public:
|
||||||
void trigger_teleport(void);
|
void trigger_teleport(void);
|
||||||
|
|
||||||
virtual void Touch(entity);
|
virtual void Touch(entity);
|
||||||
|
|
||||||
|
virtual void Spawned(void);
|
||||||
virtual void Respawn(void);
|
virtual void Respawn(void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
string m_sndTeleported;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
trigger_teleport::trigger_teleport(void)
|
trigger_teleport::trigger_teleport(void)
|
||||||
{
|
{
|
||||||
|
m_sndTeleported = __NULL__;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
trigger_teleport::Spawned(void)
|
||||||
|
{
|
||||||
|
super::Spawned();
|
||||||
|
|
||||||
|
/* if we're in Deathmatch Classic, force this soundDef */
|
||||||
|
if (cvar_string("fs_game") == "dmc") {
|
||||||
|
m_sndTeleported = "dmc_teleporter.teleported";
|
||||||
|
}
|
||||||
|
Sound_Precache(m_sndTeleported);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -78,6 +96,10 @@ trigger_teleport::Touch(entity eToucher)
|
||||||
if (eToucher.flags & FL_CLIENT)
|
if (eToucher.flags & FL_CLIENT)
|
||||||
Client_FixAngle(eToucher, eToucher.angles);
|
Client_FixAngle(eToucher, eToucher.angles);
|
||||||
|
|
||||||
|
if (m_sndTeleported) {
|
||||||
|
Sound_Play(eToucher, CHAN_VOICE, m_sndTeleported);
|
||||||
|
}
|
||||||
|
|
||||||
NSLog("^2trigger_teleport::^3Touch^7: Teleported '%s' to `%v`",
|
NSLog("^2trigger_teleport::^3Touch^7: Teleported '%s' to `%v`",
|
||||||
eToucher.netname, endpos);
|
eToucher.netname, endpos);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue