trigger_teleport: if we're running fs_game "dmc", then force a teleportation sound to play.

This commit is contained in:
Marco Cawthorne 2023-04-17 12:22:56 -07:00
parent a8144ce6c1
commit ed2d73106f
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 22 additions and 0 deletions

View File

@ -39,12 +39,30 @@ public:
void trigger_teleport(void);
virtual void Touch(entity);
virtual void Spawned(void);
virtual void Respawn(void);
private:
string m_sndTeleported;
};
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
@ -78,6 +96,10 @@ trigger_teleport::Touch(entity eToucher)
if (eToucher.flags & FL_CLIENT)
Client_FixAngle(eToucher, eToucher.angles);
if (m_sndTeleported) {
Sound_Play(eToucher, CHAN_VOICE, m_sndTeleported);
}
NSLog("^2trigger_teleport::^3Touch^7: Teleported '%s' to `%v`",
eToucher.netname, endpos);
} else {