diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index d1ea1e116..603b54973 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -460,7 +460,13 @@ void CCharacter::FireWeapon() Server()->SendMsg(&Msg, 0,m_pPlayer->GetCID()); GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE);*/ - new CLaser(&GameServer()->m_World, m_Pos, Direction, GameServer()->Tuning()->m_LaserReach, m_pPlayer->GetCID(), WEAPON_SHOTGUN); + float LaserReach; + if (!m_TuneZone) + LaserReach = GameServer()->Tuning()->m_LaserReach; + else + LaserReach = (GameServer()->TuningList()+m_TuneZone)->m_LaserReach; + + new CLaser(&GameServer()->m_World, m_Pos, Direction, LaserReach, m_pPlayer->GetCID(), WEAPON_SHOTGUN); GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID())); } break; @@ -470,7 +476,7 @@ void CCharacter::FireWeapon() if (!m_TuneZone) Lifetime = (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_GrenadeLifetime); else - Lifetime = (int)(Server()->TickSpeed()*(GameServer()->TuningList()+m_TuneZone)->m_GrenadeLifetime); + Lifetime = (int)(Server()->TickSpeed()*(GameServer()->TuningList()+m_TuneZone)->m_GrenadeLifetime); CProjectile *pProj = new CProjectile ( @@ -502,11 +508,11 @@ void CCharacter::FireWeapon() case WEAPON_RIFLE: { - int LaserReach; + float LaserReach; if (!m_TuneZone) - LaserReach = (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_LaserReach); + LaserReach = GameServer()->Tuning()->m_LaserReach; else - LaserReach = (int)(Server()->TickSpeed()*(GameServer()->TuningList()+m_TuneZone)->m_LaserReach); + LaserReach = (GameServer()->TuningList()+m_TuneZone)->m_LaserReach; new CLaser(GameWorld(), m_Pos, Direction, LaserReach, m_pPlayer->GetCID(), WEAPON_RIFLE); GameServer()->CreateSound(m_Pos, SOUND_RIFLE_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID())); diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp index b451dca48..954f1095f 100644 --- a/src/game/server/entities/laser.cpp +++ b/src/game/server/entities/laser.cpp @@ -23,7 +23,7 @@ CLaser::CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEner GameWorld()->InsertEntity(this); DoBounce(); m_TeamMask = GameServer()->GetPlayerChar(Owner) ? GameServer()->GetPlayerChar(Owner)->Teams()->TeamMask(GameServer()->GetPlayerChar(Owner)->Team(), -1, m_Owner) : 0; - m_TuneZone = GameServer()->GetPlayerChar(m_Owner)->m_TuneZone; + m_TuneZone = GameServer()->Collision()->IsTune(GameServer()->Collision()->GetMapIndex(m_Pos)); } @@ -137,7 +137,7 @@ void CLaser::DoBounce() } int BounceNum = GameServer()->Tuning()->m_LaserBounceNum; - if (!m_TuneZone) + if (m_TuneZone) BounceNum = (GameServer()->TuningList()+m_TuneZone)->m_LaserBounceNum; if(m_Bounces > BounceNum) @@ -165,16 +165,14 @@ void CLaser::Reset() void CLaser::Tick() { - if (!m_TuneZone) - { - if(Server()->Tick() > m_EvalTick+(Server()->TickSpeed()*GameServer()->Tuning()->m_LaserBounceDelay)/1000.0f) - DoBounce(); - } + float Delay; + if (m_TuneZone) + Delay = (GameServer()->TuningList()+m_TuneZone)->m_LaserBounceDelay; else - { - if(Server()->Tick() > m_EvalTick+(Server()->TickSpeed()*(GameServer()->TuningList()+m_TuneZone)->m_LaserBounceDelay)/1000.0f) - DoBounce(); - } + Delay = GameServer()->Tuning()->m_LaserBounceDelay; + + if(Server()->Tick() > m_EvalTick+(Server()->TickSpeed()*Delay/1000.0f)) + DoBounce(); } void CLaser::TickPaused() diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp index f2006fecc..fc29b3932 100644 --- a/src/game/server/entities/projectile.cpp +++ b/src/game/server/entities/projectile.cpp @@ -42,7 +42,7 @@ CProjectile::CProjectile m_Number = Number; m_Freeze = Freeze; - m_TuneZone = GameServer()->GetPlayerChar(m_Owner)->m_TuneZone; + m_TuneZone = GameServer()->Collision()->IsTune(GameServer()->Collision()->GetMapIndex(m_Pos)); GameWorld()->InsertEntity(this); }