diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp index a81846fdf..51151ced4 100644 --- a/src/game/server/entities/laser.cpp +++ b/src/game/server/entities/laser.cpp @@ -19,6 +19,7 @@ CLaser::CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEner m_Type = Type; GameWorld()->InsertEntity(this); DoBounce(); + m_TeamMask = GameServer()->GetPlayerChar(Owner) ? GameServer()->GetPlayerChar(Owner)->Teams()->TeamMask(GameServer()->GetPlayerChar(Owner)->Team()) : 0; } @@ -109,10 +110,8 @@ void CLaser::DoBounce() if(m_Bounces > GameServer()->Tuning()->m_LaserBounceNum) m_Energy = -1; - if(OwnerChar) - GameServer()->CreateSound(m_Pos, SOUND_RIFLE_BOUNCE, OwnerChar->Teams()->TeamMask(OwnerChar->Team())); - else - GameServer()->CreateSound(m_Pos, SOUND_RIFLE_BOUNCE, 0); + + GameServer()->CreateSound(m_Pos, SOUND_RIFLE_BOUNCE, OwnerChar->Teams()->TeamMask(m_TeamMask)); } } else diff --git a/src/game/server/entities/laser.h b/src/game/server/entities/laser.h index b4018670a..522f339fa 100644 --- a/src/game/server/entities/laser.h +++ b/src/game/server/entities/laser.h @@ -25,6 +25,7 @@ private: int m_Bounces; int m_EvalTick; int m_Owner; + int m_TeamMask; // DDRace