mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Fixing the sound for the laser when a player DCs after shooting it
This commit is contained in:
parent
8f927a6033
commit
dd015c33c0
|
@ -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
|
||||
|
|
|
@ -25,6 +25,7 @@ private:
|
|||
int m_Bounces;
|
||||
int m_EvalTick;
|
||||
int m_Owner;
|
||||
int m_TeamMask;
|
||||
|
||||
// DDRace
|
||||
|
||||
|
|
Loading…
Reference in a new issue