Skip to content

Commit

Permalink
Only deactivate the tractor beam when it is still active.
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Teach committed Mar 5, 2011
1 parent a2472ba commit e80e24d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Questor.Modules/Salvage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ private void ActivateTractorBeams()

var wreck = wrecks.FirstOrDefault(w => w.Id == tractorBeam.TargetId);
// If the wreck no longer exists, or its within loot range then disable the tractor beam
if (wreck == null || wreck.Distance <= 2500)
if (tractorBeam.IsActive && (wreck == null || wreck.Distance <= 2500))
tractorBeam.Deactivate();

// Remove the tractor beam as a possible beam to activate
tractorBeams.RemoveAt(i);
wrecks.RemoveAll(w => w.Id == tractorBeam.TargetId);
}
Expand Down

0 comments on commit e80e24d

Please sign in to comment.