Fixing the sound for the laser when a player DCs after shooting it

This commit is contained in:
GreYFoX 2011-07-22 14:58:06 +02:00
parent 8f927a6033
commit dd015c33c0
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -25,6 +25,7 @@ private:
int m_Bounces;
int m_EvalTick;
int m_Owner;
int m_TeamMask;
// DDRace