KeenSoftwareHouse / SpaceEngineers

2.93k stars 896 forks source link

Fix for: Sandbox.Game.Weapons.MyLargeTurretBase.IsTargetVisible(MyEntity target, Vector3D predictedPos) #568

Open Dondelium opened 7 years ago

Dondelium commented 7 years ago

In MyLargeTurretBase at line 1004:

            bool isAimed = (Target != null || m_currentPrediction.ManualTargetPosition) && RotationAndElevation() && CanShoot(out gunStatus) && IsTargetVisible(Target);

to remove a crash you could change to:

            bool isAimed = ( RotationAndElevation() && CanShoot(out gunStatus) && ((Target != null &&  IsTargetVisible(Target)) || m_currentPrediction.ManualTargetPosition) );